<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{- |

A rich user interface for line input in command-line programs.  Haskeline is
Unicode-aware and runs both on POSIX-compatible systems and on Windows.

Users may customize the interface with a @~/.haskeline@ file; see
&lt;https://github.com/judah/haskeline/wiki/UserPreferences&gt; for more information.

An example use of this library for a simple read-eval-print loop (REPL) is the
following:

&gt; import System.Console.Haskeline
&gt;
&gt; main :: IO ()
&gt; main = runInputT defaultSettings loop
&gt;    where
&gt;        loop :: InputT IO ()
&gt;        loop = do
&gt;            minput &lt;- getInputLine &quot;% &quot;
&gt;            case minput of
&gt;                Nothing -&gt; return ()
&gt;                Just &quot;quit&quot; -&gt; return ()
&gt;                Just input -&gt; do outputStrLn $ &quot;Input was: &quot; ++ input
&gt;                                 loop

-}</span><span>
</span><span id="line-27"></span><span>
</span><span id="line-28"></span><span>
</span><span id="line-29"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">System.Console.Haskeline</span><span class="hs-special">(</span><span>
</span><span id="line-30"></span><span>                    </span><span class="annot"><span class="hs-comment">-- * Interactive sessions</span></span><span>
</span><span id="line-31"></span><span>                    </span><span class="annot"><span class="hs-comment">-- ** The InputT monad transformer</span></span><span>
</span><span id="line-32"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#InputT"><span class="hs-identifier">InputT</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-33"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#runInputT"><span class="hs-identifier">runInputT</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-34"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#haveTerminalUI"><span class="hs-identifier">haveTerminalUI</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-35"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#mapInputT"><span class="hs-identifier">mapInputT</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-36"></span><span>                    </span><span class="annot"><span class="hs-comment">-- ** Behaviors</span></span><span>
</span><span id="line-37"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#Behavior"><span class="hs-identifier">Behavior</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-38"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#runInputTBehavior"><span class="hs-identifier">runInputTBehavior</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-39"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#defaultBehavior"><span class="hs-identifier">defaultBehavior</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-40"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#useFileHandle"><span class="hs-identifier">useFileHandle</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-41"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#useFile"><span class="hs-identifier">useFile</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-42"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#preferTerm"><span class="hs-identifier">preferTerm</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-43"></span><span>                    </span><span class="annot"><span class="hs-comment">-- * User interaction functions</span></span><span>
</span><span id="line-44"></span><span>                    </span><span class="annot"><span class="hs-comment">-- ** Reading user input</span></span><span>
</span><span id="line-45"></span><span>                    </span><span class="annot"><span class="hs-comment">-- $inputfncs</span></span><span>
</span><span id="line-46"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.html#getInputLine"><span class="hs-identifier">getInputLine</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-47"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.html#getInputLineWithInitial"><span class="hs-identifier">getInputLineWithInitial</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-48"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.html#getInputChar"><span class="hs-identifier">getInputChar</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-49"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.html#getPassword"><span class="hs-identifier">getPassword</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-50"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.html#waitForAnyKey"><span class="hs-identifier">waitForAnyKey</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-51"></span><span>                    </span><span class="annot"><span class="hs-comment">-- ** Outputting text</span></span><span>
</span><span id="line-52"></span><span>                    </span><span class="annot"><span class="hs-comment">-- $outputfncs</span></span><span>
</span><span id="line-53"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.html#outputStr"><span class="hs-identifier">outputStr</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-54"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.html#outputStrLn"><span class="hs-identifier">outputStrLn</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-55"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.html#getExternalPrint"><span class="hs-identifier">getExternalPrint</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-56"></span><span>                    </span><span class="annot"><span class="hs-comment">-- * Customization</span></span><span>
</span><span id="line-57"></span><span>                    </span><span class="annot"><span class="hs-comment">-- ** Settings</span></span><span>
</span><span id="line-58"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#Settings"><span class="hs-identifier">Settings</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-59"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.html#defaultSettings"><span class="hs-identifier">defaultSettings</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-60"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#setComplete"><span class="hs-identifier">setComplete</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-61"></span><span>                    </span><span class="annot"><span class="hs-comment">-- ** User preferences</span></span><span>
</span><span id="line-62"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.Prefs.html#Prefs"><span class="hs-identifier">Prefs</span></a></span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-63"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.Prefs.html#readPrefs"><span class="hs-identifier">readPrefs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-64"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.Prefs.html#defaultPrefs"><span class="hs-identifier">defaultPrefs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-65"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#runInputTWithPrefs"><span class="hs-identifier">runInputTWithPrefs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-66"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#runInputTBehaviorWithPrefs"><span class="hs-identifier">runInputTBehaviorWithPrefs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-67"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#withRunInBase"><span class="hs-identifier">withRunInBase</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-68"></span><span>                    </span><span class="annot"><span class="hs-comment">-- ** History</span></span><span>
</span><span id="line-69"></span><span>                    </span><span class="annot"><span class="hs-comment">-- $history</span></span><span>
</span><span id="line-70"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#getHistory"><span class="hs-identifier">getHistory</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-71"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#putHistory"><span class="hs-identifier">putHistory</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-72"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#modifyHistory"><span class="hs-identifier">modifyHistory</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-73"></span><span>                    </span><span class="annot"><span class="hs-comment">-- * Ctrl-C handling</span></span><span>
</span><span id="line-74"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.html#withInterrupt"><span class="hs-identifier">withInterrupt</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-75"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.Term.html#Interrupt"><span class="hs-identifier">Interrupt</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-76"></span><span>                    </span><span class="annot"><a href="System.Console.Haskeline.html#handleInterrupt"><span class="hs-identifier">handleInterrupt</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-77"></span><span>                    </span><span class="annot"><span class="hs-comment">-- * Additional submodules</span></span><span>
</span><span id="line-78"></span><span>                    </span><span class="hs-keyword">module</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Completion.html"><span class="hs-identifier">System.Console.Haskeline.Completion</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-79"></span><span>                     </span><span class="hs-keyword">where</span><span>
</span><span id="line-80"></span><span>
</span><span id="line-81"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html"><span class="hs-identifier">System.Console.Haskeline.LineState</span></a></span><span>
</span><span id="line-82"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Command.html"><span class="hs-identifier">System.Console.Haskeline.Command</span></a></span><span>
</span><span id="line-83"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Vi.html"><span class="hs-identifier">System.Console.Haskeline.Vi</span></a></span><span>
</span><span id="line-84"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Emacs.html"><span class="hs-identifier">System.Console.Haskeline.Emacs</span></a></span><span>
</span><span id="line-85"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Prefs.html"><span class="hs-identifier">System.Console.Haskeline.Prefs</span></a></span><span>
</span><span id="line-86"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Console.Haskeline.History.html"><span class="hs-identifier">System.Console.Haskeline.History</span></a></span><span>
</span><span id="line-87"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Monads.html"><span class="hs-identifier">System.Console.Haskeline.Monads</span></a></span><span>
</span><span id="line-88"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Console.Haskeline.InputT.html"><span class="hs-identifier">System.Console.Haskeline.InputT</span></a></span><span>
</span><span id="line-89"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Completion.html"><span class="hs-identifier">System.Console.Haskeline.Completion</span></a></span><span>
</span><span id="line-90"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Term.html"><span class="hs-identifier">System.Console.Haskeline.Term</span></a></span><span>
</span><span id="line-91"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Key.html"><span class="hs-identifier">System.Console.Haskeline.Key</span></a></span><span>
</span><span id="line-92"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Console.Haskeline.RunCommand.html"><span class="hs-identifier">System.Console.Haskeline.RunCommand</span></a></span><span>
</span><span id="line-93"></span><span>
</span><span id="line-94"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../exceptions/src/Control.Monad.Catch.html#"><span class="hs-identifier">Control.Monad.Catch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../exceptions/src/Control.Monad.Catch.html#MonadMask"><span class="hs-identifier">MonadMask</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../exceptions/src/Control.Monad.Catch.html#handle"><span class="hs-identifier">handle</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-95"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Char.html#"><span class="hs-identifier">Data.Char</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Unicode.html#isSpace"><span class="hs-identifier">isSpace</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Unicode.html#isPrint"><span class="hs-identifier">isPrint</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-96"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Maybe.html#"><span class="hs-identifier">Data.Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Maybe.html#isJust"><span class="hs-identifier">isJust</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-97"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/System.IO.html#"><span class="hs-identifier">System.IO</span></a></span><span>
</span><span id="line-98"></span><span>
</span><span id="line-99"></span><span>
</span><span id="line-100"></span><span class="hs-comment">-- | A useful default.  In particular:</span><span>
</span><span id="line-101"></span><span class="hs-comment">--</span><span>
</span><span id="line-102"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-103"></span><span class="hs-comment">-- defaultSettings = Settings {</span><span>
</span><span id="line-104"></span><span class="hs-comment">--           complete = completeFilename,</span><span>
</span><span id="line-105"></span><span class="hs-comment">--           historyFile = Nothing,</span><span>
</span><span id="line-106"></span><span class="hs-comment">--           autoAddHistory = True</span><span>
</span><span id="line-107"></span><span class="hs-comment">--           }</span><span>
</span><span id="line-108"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-109"></span><span id="local-6989586621679100301"><span class="annot"><a href="System.Console.Haskeline.html#defaultSettings"><span class="hs-identifier hs-type">defaultSettings</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100301"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#Settings"><span class="hs-identifier hs-type">Settings</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100301"><span class="hs-identifier hs-type">m</span></a></span></span><span>
</span><span id="line-110"></span><span id="defaultSettings"><span class="annot"><span class="annottext">defaultSettings :: forall (m :: * -&gt; *). MonadIO m =&gt; Settings m
</span><a href="System.Console.Haskeline.html#defaultSettings"><span class="hs-identifier hs-var hs-var">defaultSettings</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Settings :: forall (m :: * -&gt; *).
CompletionFunc m -&gt; Maybe FilePath -&gt; Bool -&gt; Settings m
</span><a href="System.Console.Haskeline.InputT.html#Settings"><span class="hs-identifier hs-type">Settings</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">complete :: CompletionFunc m
</span><a href="System.Console.Haskeline.InputT.html#complete"><span class="hs-identifier hs-var">complete</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CompletionFunc m
forall (m :: * -&gt; *). MonadIO m =&gt; CompletionFunc m
</span><a href="System.Console.Haskeline.Completion.html#completeFilename"><span class="hs-identifier hs-var">completeFilename</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-111"></span><span>                        </span><span class="annot"><span class="annottext">historyFile :: Maybe FilePath
</span><a href="System.Console.Haskeline.InputT.html#historyFile"><span class="hs-identifier hs-var">historyFile</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe FilePath
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-112"></span><span>                        </span><span class="annot"><span class="annottext">autoAddHistory :: Bool
</span><a href="System.Console.Haskeline.InputT.html#autoAddHistory"><span class="hs-identifier hs-var">autoAddHistory</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">}</span><span>
</span><span id="line-113"></span><span>
</span><span id="line-114"></span><span class="hs-comment">{- $outputfncs
The following functions enable cross-platform output of text that may contain
Unicode characters.
-}</span><span>
</span><span id="line-118"></span><span>
</span><span id="line-119"></span><span class="hs-comment">-- | Write a Unicode string to the user's standard output.</span><span>
</span><span id="line-120"></span><span id="local-6989586621679100292"><span class="annot"><a href="System.Console.Haskeline.html#outputStr"><span class="hs-identifier hs-type">outputStr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100292"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#InputT"><span class="hs-identifier hs-type">InputT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100292"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-121"></span><span id="outputStr"><span class="annot"><span class="annottext">outputStr :: forall (m :: * -&gt; *). MonadIO m =&gt; FilePath -&gt; InputT m ()
</span><a href="System.Console.Haskeline.html#outputStr"><span class="hs-identifier hs-var hs-var">outputStr</span></a></span></span><span> </span><span id="local-6989586621679100041"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679100041"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-122"></span><span>    </span><span id="local-6989586621679100040"><span class="annot"><span class="annottext">FilePath -&gt; IO ()
</span><a href="#local-6989586621679100040"><span class="hs-identifier hs-var">putter</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReaderT
  RunTerm
  (ReaderT
     (IORef History)
     (ReaderT
        (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))
  (FilePath -&gt; IO ())
-&gt; InputT m (FilePath -&gt; IO ())
forall (m :: * -&gt; *) a.
ReaderT
  RunTerm
  (ReaderT
     (IORef History)
     (ReaderT
        (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))
  a
-&gt; InputT m a
</span><a href="System.Console.Haskeline.InputT.html#InputT"><span class="hs-identifier hs-var">InputT</span></a></span><span> </span><span class="annot"><span class="annottext">(ReaderT
   RunTerm
   (ReaderT
      (IORef History)
      (ReaderT
         (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))
   (FilePath -&gt; IO ())
 -&gt; InputT m (FilePath -&gt; IO ()))
-&gt; ReaderT
     RunTerm
     (ReaderT
        (IORef History)
        (ReaderT
           (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))
     (FilePath -&gt; IO ())
-&gt; InputT m (FilePath -&gt; IO ())
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(RunTerm -&gt; FilePath -&gt; IO ())
-&gt; ReaderT
     RunTerm
     (ReaderT
        (IORef History)
        (ReaderT
           (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))
     (FilePath -&gt; IO ())
forall r (m :: * -&gt; *) a. MonadReader r m =&gt; (r -&gt; a) -&gt; m a
</span><a href="System.Console.Haskeline.Monads.html#asks"><span class="hs-identifier hs-var">asks</span></a></span><span> </span><span class="annot"><span class="annottext">RunTerm -&gt; FilePath -&gt; IO ()
</span><a href="System.Console.Haskeline.Term.html#putStrOut"><span class="hs-identifier hs-var hs-var">putStrOut</span></a></span><span>
</span><span id="line-123"></span><span>    </span><span class="annot"><span class="annottext">IO () -&gt; InputT m ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; InputT m ()) -&gt; IO () -&gt; InputT m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IO ()
</span><a href="#local-6989586621679100040"><span class="hs-identifier hs-var">putter</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679100041"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-124"></span><span>
</span><span id="line-125"></span><span class="hs-comment">-- | Write a string to the user's standard output, followed by a newline.</span><span>
</span><span id="line-126"></span><span id="local-6989586621679100035"><span class="annot"><a href="System.Console.Haskeline.html#outputStrLn"><span class="hs-identifier hs-type">outputStrLn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100035"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#InputT"><span class="hs-identifier hs-type">InputT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100035"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-127"></span><span id="outputStrLn"><span class="annot"><span class="annottext">outputStrLn :: forall (m :: * -&gt; *). MonadIO m =&gt; FilePath -&gt; InputT m ()
</span><a href="System.Console.Haskeline.html#outputStrLn"><span class="hs-identifier hs-var hs-var">outputStrLn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; InputT m ()
forall (m :: * -&gt; *). MonadIO m =&gt; FilePath -&gt; InputT m ()
</span><a href="System.Console.Haskeline.html#outputStr"><span class="hs-identifier hs-var">outputStr</span></a></span><span> </span><span class="annot"><span class="annottext">(FilePath -&gt; InputT m ())
-&gt; (FilePath -&gt; FilePath) -&gt; FilePath -&gt; InputT m ()
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;\n&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-128"></span><span>
</span><span id="line-129"></span><span>
</span><span id="line-130"></span><span class="hs-comment">{- $inputfncs
The following functions read one line or character of input from the user.

They return `Nothing` if they encounter the end of input.  More specifically:

- When using terminal-style interaction, they return `Nothing` if the user
  pressed @Ctrl-D@ when the input text was empty.

- When using file-style interaction, they return `Nothing` if an @EOF@ was
  encountered before any characters were read.
-}</span><span>
</span><span id="line-141"></span><span>
</span><span id="line-142"></span><span>
</span><span id="line-143"></span><span class="hs-comment">{- | Reads one line of input.  The final newline (if any) is removed.  When using terminal-style interaction, this function provides a rich line-editing user interface.

If @'autoAddHistory' == 'True'@ and the line input is nonblank (i.e., is not all
spaces), it will be automatically added to the history.
-}</span><span>
</span><span id="line-148"></span><span id="local-6989586621679100263"><span class="annot"><a href="System.Console.Haskeline.html#getInputLine"><span class="hs-identifier hs-type">getInputLine</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100263"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../exceptions/src/Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100263"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-149"></span><span>            </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-comment">-- ^ The input prompt</span><span>
</span><span id="line-150"></span><span>                            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#InputT"><span class="hs-identifier hs-type">InputT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100263"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-151"></span><span id="getInputLine"><span class="annot"><span class="annottext">getInputLine :: forall (m :: * -&gt; *).
(MonadIO m, MonadMask m) =&gt;
FilePath -&gt; InputT m (Maybe FilePath)
</span><a href="System.Console.Haskeline.html#getInputLine"><span class="hs-identifier hs-var hs-var">getInputLine</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TermOps -&gt; Prefix -&gt; InputT m (Maybe FilePath))
-&gt; (FileOps -&gt; IO (Maybe FilePath))
-&gt; FilePath
-&gt; InputT m (Maybe FilePath)
forall (m :: * -&gt; *) a.
MonadIO m =&gt;
(TermOps -&gt; Prefix -&gt; InputT m a)
-&gt; (FileOps -&gt; IO a) -&gt; FilePath -&gt; InputT m a
</span><a href="System.Console.Haskeline.html#promptedInput"><span class="hs-identifier hs-var">promptedInput</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InsertMode -&gt; TermOps -&gt; Prefix -&gt; InputT m (Maybe FilePath)
forall (m :: * -&gt; *).
(MonadIO m, MonadMask m) =&gt;
InsertMode -&gt; TermOps -&gt; Prefix -&gt; InputT m (Maybe FilePath)
</span><a href="System.Console.Haskeline.html#getInputCmdLine"><span class="hs-identifier hs-var">getInputCmdLine</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="System.Console.Haskeline.LineState.html#emptyIM"><span class="hs-identifier hs-var">emptyIM</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">((FileOps -&gt; IO (Maybe FilePath))
 -&gt; FilePath -&gt; InputT m (Maybe FilePath))
-&gt; (FileOps -&gt; IO (Maybe FilePath))
-&gt; FilePath
-&gt; InputT m (Maybe FilePath)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">MaybeT IO FilePath -&gt; IO (Maybe FilePath)
forall (m :: * -&gt; *) a. MaybeT m a -&gt; m (Maybe a)
</span><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#runMaybeT"><span class="hs-identifier hs-var hs-var">runMaybeT</span></a></span><span> </span><span class="annot"><span class="annottext">(MaybeT IO FilePath -&gt; IO (Maybe FilePath))
-&gt; (FileOps -&gt; MaybeT IO FilePath)
-&gt; FileOps
-&gt; IO (Maybe FilePath)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">FileOps -&gt; MaybeT IO FilePath
</span><a href="System.Console.Haskeline.Term.html#getLocaleLine"><span class="hs-identifier hs-var hs-var">getLocaleLine</span></a></span><span>
</span><span id="line-152"></span><span>
</span><span id="line-153"></span><span class="hs-comment">{- | Reads one line of input and fills the insertion space with initial text. When using
terminal-style interaction, this function provides a rich line-editing user interface with the
added ability to give the user default values.

This function behaves in the exact same manner as 'getInputLine', except that
it pre-populates the input area. The text that resides in the input area is given as a 2-tuple
with two 'String's.   The string on the left of the tuple (obtained by calling 'fst') is
what will appear to the left of the cursor and the string on the right (obtained by
calling 'snd') is what will appear to the right of the cursor.

Some examples of calling of this function are:

&gt; getInputLineWithInitial &quot;prompt&gt; &quot; (&quot;left&quot;, &quot;&quot;) -- The cursor starts at the end of the line.
&gt; getInputLineWithInitial &quot;prompt&gt; &quot; (&quot;left &quot;, &quot;right&quot;) -- The cursor starts before the second word.
 -}</span><span>
</span><span id="line-168"></span><span id="local-6989586621679100250"><span class="annot"><a href="System.Console.Haskeline.html#getInputLineWithInitial"><span class="hs-identifier hs-type">getInputLineWithInitial</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100250"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../exceptions/src/Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100250"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-169"></span><span>                            </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>           </span><span class="hs-comment">-- ^ The input prompt</span><span>
</span><span id="line-170"></span><span>                            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ The initial value left and right of the cursor</span><span>
</span><span id="line-171"></span><span>                            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#InputT"><span class="hs-identifier hs-type">InputT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100250"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-172"></span><span id="getInputLineWithInitial"><span class="annot"><span class="annottext">getInputLineWithInitial :: forall (m :: * -&gt; *).
(MonadIO m, MonadMask m) =&gt;
FilePath -&gt; (FilePath, FilePath) -&gt; InputT m (Maybe FilePath)
</span><a href="System.Console.Haskeline.html#getInputLineWithInitial"><span class="hs-identifier hs-var hs-var">getInputLineWithInitial</span></a></span></span><span> </span><span id="local-6989586621679100016"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679100016"><span class="hs-identifier hs-var">prompt</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679100015"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679100015"><span class="hs-identifier hs-var">left</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679100014"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679100014"><span class="hs-identifier hs-var">right</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TermOps -&gt; Prefix -&gt; InputT m (Maybe FilePath))
-&gt; (FileOps -&gt; IO (Maybe FilePath))
-&gt; FilePath
-&gt; InputT m (Maybe FilePath)
forall (m :: * -&gt; *) a.
MonadIO m =&gt;
(TermOps -&gt; Prefix -&gt; InputT m a)
-&gt; (FileOps -&gt; IO a) -&gt; FilePath -&gt; InputT m a
</span><a href="System.Console.Haskeline.html#promptedInput"><span class="hs-identifier hs-var">promptedInput</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InsertMode -&gt; TermOps -&gt; Prefix -&gt; InputT m (Maybe FilePath)
forall (m :: * -&gt; *).
(MonadIO m, MonadMask m) =&gt;
InsertMode -&gt; TermOps -&gt; Prefix -&gt; InputT m (Maybe FilePath)
</span><a href="System.Console.Haskeline.html#getInputCmdLine"><span class="hs-identifier hs-var">getInputCmdLine</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679100013"><span class="hs-identifier hs-var">initialIM</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-173"></span><span>                                                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MaybeT IO FilePath -&gt; IO (Maybe FilePath)
forall (m :: * -&gt; *) a. MaybeT m a -&gt; m (Maybe a)
</span><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#runMaybeT"><span class="hs-identifier hs-var hs-var">runMaybeT</span></a></span><span> </span><span class="annot"><span class="annottext">(MaybeT IO FilePath -&gt; IO (Maybe FilePath))
-&gt; (FileOps -&gt; MaybeT IO FilePath)
-&gt; FileOps
-&gt; IO (Maybe FilePath)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">FileOps -&gt; MaybeT IO FilePath
</span><a href="System.Console.Haskeline.Term.html#getLocaleLine"><span class="hs-identifier hs-var hs-var">getLocaleLine</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679100016"><span class="hs-identifier hs-var">prompt</span></a></span><span>
</span><span id="line-174"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-175"></span><span>    </span><span id="local-6989586621679100013"><span class="annot"><span class="annottext">initialIM :: InsertMode
</span><a href="#local-6989586621679100013"><span class="hs-identifier hs-var hs-var">initialIM</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; InsertMode -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#insertString"><span class="hs-identifier hs-var">insertString</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679100015"><span class="hs-identifier hs-var">left</span></a></span><span> </span><span class="annot"><span class="annottext">(InsertMode -&gt; InsertMode) -&gt; InsertMode -&gt; InsertMode
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode -&gt; InsertMode
forall s. Move s =&gt; s -&gt; s
</span><a href="System.Console.Haskeline.LineState.html#moveToStart"><span class="hs-identifier hs-var">moveToStart</span></a></span><span> </span><span class="annot"><span class="annottext">(InsertMode -&gt; InsertMode) -&gt; InsertMode -&gt; InsertMode
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; InsertMode -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#insertString"><span class="hs-identifier hs-var">insertString</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679100014"><span class="hs-identifier hs-var">right</span></a></span><span> </span><span class="annot"><span class="annottext">(InsertMode -&gt; InsertMode) -&gt; InsertMode -&gt; InsertMode
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="System.Console.Haskeline.LineState.html#emptyIM"><span class="hs-identifier hs-var">emptyIM</span></a></span><span>
</span><span id="line-176"></span><span>
</span><span id="line-177"></span><span id="local-6989586621679100254"><span class="annot"><a href="System.Console.Haskeline.html#getInputCmdLine"><span class="hs-identifier hs-type">getInputCmdLine</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100254"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../exceptions/src/Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100254"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Term.html#TermOps"><span class="hs-identifier hs-type">TermOps</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Prefix"><span class="hs-identifier hs-type">Prefix</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#InputT"><span class="hs-identifier hs-type">InputT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100254"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-178"></span><span id="getInputCmdLine"><span class="annot"><span class="annottext">getInputCmdLine :: forall (m :: * -&gt; *).
(MonadIO m, MonadMask m) =&gt;
InsertMode -&gt; TermOps -&gt; Prefix -&gt; InputT m (Maybe FilePath)
</span><a href="System.Console.Haskeline.html#getInputCmdLine"><span class="hs-identifier hs-var hs-var">getInputCmdLine</span></a></span></span><span> </span><span id="local-6989586621679099934"><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679099934"><span class="hs-identifier hs-var">initialIM</span></a></span></span><span> </span><span id="local-6989586621679099933"><span class="annot"><span class="annottext">TermOps
</span><a href="#local-6989586621679099933"><span class="hs-identifier hs-var">tops</span></a></span></span><span> </span><span id="local-6989586621679099932"><span class="annot"><span class="annottext">Prefix
</span><a href="#local-6989586621679099932"><span class="hs-identifier hs-var">prefix</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-179"></span><span>    </span><span id="local-6989586621679099931"><span class="annot"><span class="annottext">EditMode
</span><a href="#local-6989586621679099931"><span class="hs-identifier hs-var">emode</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReaderT
  RunTerm
  (ReaderT
     (IORef History)
     (ReaderT
        (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))
  EditMode
-&gt; InputT m EditMode
forall (m :: * -&gt; *) a.
ReaderT
  RunTerm
  (ReaderT
     (IORef History)
     (ReaderT
        (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))
  a
-&gt; InputT m a
</span><a href="System.Console.Haskeline.InputT.html#InputT"><span class="hs-identifier hs-var">InputT</span></a></span><span> </span><span class="annot"><span class="annottext">(ReaderT
   RunTerm
   (ReaderT
      (IORef History)
      (ReaderT
         (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))
   EditMode
 -&gt; InputT m EditMode)
-&gt; ReaderT
     RunTerm
     (ReaderT
        (IORef History)
        (ReaderT
           (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))
     EditMode
-&gt; InputT m EditMode
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(Prefs -&gt; EditMode)
-&gt; ReaderT
     RunTerm
     (ReaderT
        (IORef History)
        (ReaderT
           (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))
     EditMode
forall r (m :: * -&gt; *) a. MonadReader r m =&gt; (r -&gt; a) -&gt; m a
</span><a href="System.Console.Haskeline.Monads.html#asks"><span class="hs-identifier hs-var">asks</span></a></span><span> </span><span class="annot"><span class="annottext">Prefs -&gt; EditMode
</span><a href="System.Console.Haskeline.Prefs.html#editMode"><span class="hs-identifier hs-var hs-var">editMode</span></a></span><span>
</span><span id="line-180"></span><span>    </span><span id="local-6989586621679099929"><span class="annot"><span class="annottext">Maybe FilePath
</span><a href="#local-6989586621679099929"><span class="hs-identifier hs-var">result</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TermOps
-&gt; InputCmdT m (Maybe FilePath) -&gt; InputT m (Maybe FilePath)
forall (m :: * -&gt; *) a.
MonadIO m =&gt;
TermOps -&gt; InputCmdT m a -&gt; InputT m a
</span><a href="System.Console.Haskeline.InputT.html#runInputCmdT"><span class="hs-identifier hs-var">runInputCmdT</span></a></span><span> </span><span class="annot"><span class="annottext">TermOps
</span><a href="#local-6989586621679099933"><span class="hs-identifier hs-var">tops</span></a></span><span> </span><span class="annot"><span class="annottext">(InputCmdT m (Maybe FilePath) -&gt; InputT m (Maybe FilePath))
-&gt; InputCmdT m (Maybe FilePath) -&gt; InputT m (Maybe FilePath)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">EditMode
</span><a href="#local-6989586621679099931"><span class="hs-identifier hs-var">emode</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-181"></span><span>                </span><span class="annot"><span class="annottext">EditMode
</span><a href="System.Console.Haskeline.Prefs.html#Emacs"><span class="hs-identifier hs-var">Emacs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TermOps
-&gt; Prefix
-&gt; KeyCommand (InputCmdT m) InsertMode (Maybe FilePath)
-&gt; InsertMode
-&gt; InputCmdT m (Maybe FilePath)
forall (m :: * -&gt; *) s a.
(CommandMonad m, MonadState Layout m, LineState s) =&gt;
TermOps -&gt; Prefix -&gt; KeyCommand m s a -&gt; s -&gt; m a
</span><a href="System.Console.Haskeline.RunCommand.html#runCommandLoop"><span class="hs-identifier hs-var">runCommandLoop</span></a></span><span> </span><span class="annot"><span class="annottext">TermOps
</span><a href="#local-6989586621679099933"><span class="hs-identifier hs-var">tops</span></a></span><span> </span><span class="annot"><span class="annottext">Prefix
</span><a href="#local-6989586621679099932"><span class="hs-identifier hs-var">prefix</span></a></span><span> </span><span class="annot"><span class="annottext">KeyCommand (InputCmdT m) InsertMode (Maybe FilePath)
InputKeyCmd InsertMode (Maybe FilePath)
</span><a href="System.Console.Haskeline.Emacs.html#emacsCommands"><span class="hs-identifier hs-var">emacsCommands</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679099934"><span class="hs-identifier hs-var">initialIM</span></a></span><span>
</span><span id="line-182"></span><span>                </span><span class="annot"><span class="annottext">EditMode
</span><a href="System.Console.Haskeline.Prefs.html#Vi"><span class="hs-identifier hs-var">Vi</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ViState m
-&gt; StateT (ViState m) (InputCmdT m) (Maybe FilePath)
-&gt; InputCmdT m (Maybe FilePath)
forall (m :: * -&gt; *) s a. Monad m =&gt; s -&gt; StateT s m a -&gt; m a
</span><a href="System.Console.Haskeline.Monads.html#evalStateT%27"><span class="hs-identifier hs-var">evalStateT'</span></a></span><span> </span><span class="annot"><span class="annottext">ViState m
forall (m :: * -&gt; *). Monad m =&gt; ViState m
</span><a href="System.Console.Haskeline.Vi.html#emptyViState"><span class="hs-identifier hs-var">emptyViState</span></a></span><span> </span><span class="annot"><span class="annottext">(StateT (ViState m) (InputCmdT m) (Maybe FilePath)
 -&gt; InputCmdT m (Maybe FilePath))
-&gt; StateT (ViState m) (InputCmdT m) (Maybe FilePath)
-&gt; InputCmdT m (Maybe FilePath)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-183"></span><span>                        </span><span class="annot"><span class="annottext">TermOps
-&gt; Prefix
-&gt; KeyCommand (ViT m) InsertMode (Maybe FilePath)
-&gt; InsertMode
-&gt; StateT (ViState m) (InputCmdT m) (Maybe FilePath)
forall (m :: * -&gt; *) s a.
(CommandMonad m, MonadState Layout m, LineState s) =&gt;
TermOps -&gt; Prefix -&gt; KeyCommand m s a -&gt; s -&gt; m a
</span><a href="System.Console.Haskeline.RunCommand.html#runCommandLoop"><span class="hs-identifier hs-var">runCommandLoop</span></a></span><span> </span><span class="annot"><span class="annottext">TermOps
</span><a href="#local-6989586621679099933"><span class="hs-identifier hs-var">tops</span></a></span><span> </span><span class="annot"><span class="annottext">Prefix
</span><a href="#local-6989586621679099932"><span class="hs-identifier hs-var">prefix</span></a></span><span> </span><span class="annot"><span class="annottext">KeyCommand (ViT m) InsertMode (Maybe FilePath)
InputKeyCmd InsertMode (Maybe FilePath)
</span><a href="System.Console.Haskeline.Vi.html#viKeyCommands"><span class="hs-identifier hs-var">viKeyCommands</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679099934"><span class="hs-identifier hs-var">initialIM</span></a></span><span>
</span><span id="line-184"></span><span>    </span><span class="annot"><span class="annottext">Maybe FilePath -&gt; InputT m ()
forall (m :: * -&gt; *). MonadIO m =&gt; Maybe FilePath -&gt; InputT m ()
</span><a href="System.Console.Haskeline.html#maybeAddHistory"><span class="hs-identifier hs-var">maybeAddHistory</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe FilePath
</span><a href="#local-6989586621679099929"><span class="hs-identifier hs-var">result</span></a></span><span>
</span><span id="line-185"></span><span>    </span><span class="annot"><span class="annottext">Maybe FilePath -&gt; InputT m (Maybe FilePath)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe FilePath
</span><a href="#local-6989586621679099929"><span class="hs-identifier hs-var">result</span></a></span><span>
</span><span id="line-186"></span><span>
</span><span id="line-187"></span><span class="annot"><a href="System.Console.Haskeline.html#maybeAddHistory"><span class="hs-identifier hs-type">maybeAddHistory</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679100196"><span class="annot"><a href="#local-6989586621679100196"><span class="hs-identifier hs-type">m</span></a></span></span><span> </span><span class="hs-operator">.</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100196"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#InputT"><span class="hs-identifier hs-type">InputT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100196"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-188"></span><span id="maybeAddHistory"><span class="annot"><span class="annottext">maybeAddHistory :: forall (m :: * -&gt; *). MonadIO m =&gt; Maybe FilePath -&gt; InputT m ()
</span><a href="System.Console.Haskeline.html#maybeAddHistory"><span class="hs-identifier hs-var hs-var">maybeAddHistory</span></a></span></span><span> </span><span id="local-6989586621679099893"><span class="annot"><span class="annottext">Maybe FilePath
</span><a href="#local-6989586621679099893"><span class="hs-identifier hs-var">result</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-189"></span><span>    </span><span id="local-6989586621679099892"><span class="annot"><span class="annottext">Settings m
</span><a href="#local-6989586621679099892"><span class="hs-identifier hs-var">settings</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#Settings"><span class="hs-identifier hs-type">Settings</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100196"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReaderT
  RunTerm
  (ReaderT
     (IORef History)
     (ReaderT
        (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))
  (Settings m)
-&gt; InputT m (Settings m)
forall (m :: * -&gt; *) a.
ReaderT
  RunTerm
  (ReaderT
     (IORef History)
     (ReaderT
        (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))
  a
-&gt; InputT m a
</span><a href="System.Console.Haskeline.InputT.html#InputT"><span class="hs-identifier hs-var">InputT</span></a></span><span> </span><span class="annot"><span class="annottext">ReaderT
  RunTerm
  (ReaderT
     (IORef History)
     (ReaderT
        (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))
  (Settings m)
forall r (m :: * -&gt; *). MonadReader r m =&gt; m r
</span><a href="System.Console.Haskeline.Monads.html#ask"><span class="hs-identifier hs-var">ask</span></a></span><span>
</span><span id="line-190"></span><span>    </span><span id="local-6989586621679099890"><span class="annot"><span class="annottext">HistoryDuplicates
</span><a href="#local-6989586621679099890"><span class="hs-identifier hs-var">histDupes</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReaderT
  RunTerm
  (ReaderT
     (IORef History)
     (ReaderT
        (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))
  HistoryDuplicates
-&gt; InputT m HistoryDuplicates
forall (m :: * -&gt; *) a.
ReaderT
  RunTerm
  (ReaderT
     (IORef History)
     (ReaderT
        (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))
  a
-&gt; InputT m a
</span><a href="System.Console.Haskeline.InputT.html#InputT"><span class="hs-identifier hs-var">InputT</span></a></span><span> </span><span class="annot"><span class="annottext">(ReaderT
   RunTerm
   (ReaderT
      (IORef History)
      (ReaderT
         (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))
   HistoryDuplicates
 -&gt; InputT m HistoryDuplicates)
-&gt; ReaderT
     RunTerm
     (ReaderT
        (IORef History)
        (ReaderT
           (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))
     HistoryDuplicates
-&gt; InputT m HistoryDuplicates
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(Prefs -&gt; HistoryDuplicates)
-&gt; ReaderT
     RunTerm
     (ReaderT
        (IORef History)
        (ReaderT
           (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))
     HistoryDuplicates
forall r (m :: * -&gt; *) a. MonadReader r m =&gt; (r -&gt; a) -&gt; m a
</span><a href="System.Console.Haskeline.Monads.html#asks"><span class="hs-identifier hs-var">asks</span></a></span><span> </span><span class="annot"><span class="annottext">Prefs -&gt; HistoryDuplicates
</span><a href="System.Console.Haskeline.Prefs.html#historyDuplicates"><span class="hs-identifier hs-var hs-var">historyDuplicates</span></a></span><span>
</span><span id="line-191"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe FilePath
</span><a href="#local-6989586621679099893"><span class="hs-identifier hs-var">result</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-192"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679099888"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679099888"><span class="hs-identifier hs-var">line</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Settings m -&gt; Bool
forall (m :: * -&gt; *). Settings m -&gt; Bool
</span><a href="System.Console.Haskeline.InputT.html#autoAddHistory"><span class="hs-identifier hs-var hs-var">autoAddHistory</span></a></span><span> </span><span class="annot"><span class="annottext">Settings m
</span><a href="#local-6989586621679099892"><span class="hs-identifier hs-var">settings</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; FilePath -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#all"><span class="hs-identifier hs-var">all</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="../../base/src/GHC.Unicode.html#isSpace"><span class="hs-identifier hs-var">isSpace</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679099888"><span class="hs-identifier hs-var">line</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-193"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679099884"><span class="annot"><span class="annottext">adder :: FilePath -&gt; History -&gt; History
</span><a href="#local-6989586621679099884"><span class="hs-identifier hs-var hs-var">adder</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HistoryDuplicates
</span><a href="#local-6989586621679099890"><span class="hs-identifier hs-var">histDupes</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-194"></span><span>                        </span><span class="annot"><span class="annottext">HistoryDuplicates
</span><a href="System.Console.Haskeline.Prefs.html#AlwaysAdd"><span class="hs-identifier hs-var">AlwaysAdd</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; History -&gt; History
</span><a href="System.Console.Haskeline.History.html#addHistory"><span class="hs-identifier hs-var">addHistory</span></a></span><span>
</span><span id="line-195"></span><span>                        </span><span class="annot"><span class="annottext">HistoryDuplicates
</span><a href="System.Console.Haskeline.Prefs.html#IgnoreConsecutive"><span class="hs-identifier hs-var">IgnoreConsecutive</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; History -&gt; History
</span><a href="System.Console.Haskeline.History.html#addHistoryUnlessConsecutiveDupe"><span class="hs-identifier hs-var">addHistoryUnlessConsecutiveDupe</span></a></span><span>
</span><span id="line-196"></span><span>                        </span><span class="annot"><span class="annottext">HistoryDuplicates
</span><a href="System.Console.Haskeline.Prefs.html#IgnoreAll"><span class="hs-identifier hs-var">IgnoreAll</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; History -&gt; History
</span><a href="System.Console.Haskeline.History.html#addHistoryRemovingAllDupes"><span class="hs-identifier hs-var">addHistoryRemovingAllDupes</span></a></span><span>
</span><span id="line-197"></span><span>               </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">(History -&gt; History) -&gt; InputT m ()
forall (m :: * -&gt; *).
MonadIO m =&gt;
(History -&gt; History) -&gt; InputT m ()
</span><a href="System.Console.Haskeline.InputT.html#modifyHistory"><span class="hs-identifier hs-var">modifyHistory</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; History -&gt; History
</span><a href="#local-6989586621679099884"><span class="hs-identifier hs-var">adder</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679099888"><span class="hs-identifier hs-var">line</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-198"></span><span>        </span><span class="annot"><span class="annottext">Maybe FilePath
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; InputT m ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-199"></span><span>
</span><span id="line-200"></span><span class="hs-comment">----------</span><span>
</span><span id="line-201"></span><span>
</span><span id="line-202"></span><span class="hs-comment">{- | Reads one character of input.  Ignores non-printable characters.

When using terminal-style interaction, the character will be read without waiting
for a newline.

When using file-style interaction, a newline will be read if it is immediately
available after the input character.
-}</span><span>
</span><span id="line-210"></span><span id="local-6989586621679100186"><span class="annot"><a href="System.Console.Haskeline.html#getInputChar"><span class="hs-identifier hs-type">getInputChar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100186"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../exceptions/src/Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100186"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-comment">-- ^ The input prompt</span><span>
</span><span id="line-211"></span><span>                    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#InputT"><span class="hs-identifier hs-type">InputT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100186"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span class="hs-special">)</span></span><span>
</span><span id="line-212"></span><span id="getInputChar"><span class="annot"><span class="annottext">getInputChar :: forall (m :: * -&gt; *).
(MonadIO m, MonadMask m) =&gt;
FilePath -&gt; InputT m (Maybe Char)
</span><a href="System.Console.Haskeline.html#getInputChar"><span class="hs-identifier hs-var hs-var">getInputChar</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TermOps -&gt; Prefix -&gt; InputT m (Maybe Char))
-&gt; (FileOps -&gt; IO (Maybe Char))
-&gt; FilePath
-&gt; InputT m (Maybe Char)
forall (m :: * -&gt; *) a.
MonadIO m =&gt;
(TermOps -&gt; Prefix -&gt; InputT m a)
-&gt; (FileOps -&gt; IO a) -&gt; FilePath -&gt; InputT m a
</span><a href="System.Console.Haskeline.html#promptedInput"><span class="hs-identifier hs-var">promptedInput</span></a></span><span> </span><span class="annot"><span class="annottext">TermOps -&gt; Prefix -&gt; InputT m (Maybe Char)
forall (m :: * -&gt; *).
(MonadIO m, MonadMask m) =&gt;
TermOps -&gt; Prefix -&gt; InputT m (Maybe Char)
</span><a href="System.Console.Haskeline.html#getInputCmdChar"><span class="hs-identifier hs-var">getInputCmdChar</span></a></span><span> </span><span class="annot"><span class="annottext">((FileOps -&gt; IO (Maybe Char)) -&gt; FilePath -&gt; InputT m (Maybe Char))
-&gt; (FileOps -&gt; IO (Maybe Char))
-&gt; FilePath
-&gt; InputT m (Maybe Char)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679099868"><span class="annot"><span class="annottext">FileOps
</span><a href="#local-6989586621679099868"><span class="hs-identifier hs-var">fops</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-213"></span><span>                        </span><span id="local-6989586621679099867"><span class="annot"><span class="annottext">Maybe Char
</span><a href="#local-6989586621679099867"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FileOps -&gt; IO (Maybe Char)
</span><a href="System.Console.Haskeline.html#getPrintableChar"><span class="hs-identifier hs-var">getPrintableChar</span></a></span><span> </span><span class="annot"><span class="annottext">FileOps
</span><a href="#local-6989586621679099868"><span class="hs-identifier hs-var">fops</span></a></span><span>
</span><span id="line-214"></span><span>                        </span><span class="annot"><span class="annottext">FileOps -&gt; IO ()
</span><a href="System.Console.Haskeline.Term.html#maybeReadNewline"><span class="hs-identifier hs-var hs-var">maybeReadNewline</span></a></span><span> </span><span class="annot"><span class="annottext">FileOps
</span><a href="#local-6989586621679099868"><span class="hs-identifier hs-var">fops</span></a></span><span>
</span><span id="line-215"></span><span>                        </span><span class="annot"><span class="annottext">Maybe Char -&gt; IO (Maybe Char)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Char
</span><a href="#local-6989586621679099867"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-216"></span><span>
</span><span id="line-217"></span><span class="annot"><a href="System.Console.Haskeline.html#getPrintableChar"><span class="hs-identifier hs-type">getPrintableChar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Term.html#FileOps"><span class="hs-identifier hs-type">FileOps</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span class="hs-special">)</span><span>
</span><span id="line-218"></span><span id="getPrintableChar"><span class="annot"><span class="annottext">getPrintableChar :: FileOps -&gt; IO (Maybe Char)
</span><a href="System.Console.Haskeline.html#getPrintableChar"><span class="hs-identifier hs-var hs-var">getPrintableChar</span></a></span></span><span> </span><span id="local-6989586621679099864"><span class="annot"><span class="annottext">FileOps
</span><a href="#local-6989586621679099864"><span class="hs-identifier hs-var">fops</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-219"></span><span>    </span><span id="local-6989586621679099863"><span class="annot"><span class="annottext">Maybe Char
</span><a href="#local-6989586621679099863"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">MaybeT IO Char -&gt; IO (Maybe Char)
forall (m :: * -&gt; *) a. MaybeT m a -&gt; m (Maybe a)
</span><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#runMaybeT"><span class="hs-identifier hs-var hs-var">runMaybeT</span></a></span><span> </span><span class="annot"><span class="annottext">(MaybeT IO Char -&gt; IO (Maybe Char))
-&gt; MaybeT IO Char -&gt; IO (Maybe Char)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FileOps -&gt; MaybeT IO Char
</span><a href="System.Console.Haskeline.Term.html#getLocaleChar"><span class="hs-identifier hs-var hs-var">getLocaleChar</span></a></span><span> </span><span class="annot"><span class="annottext">FileOps
</span><a href="#local-6989586621679099864"><span class="hs-identifier hs-var">fops</span></a></span><span>
</span><span id="line-220"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; Maybe Char -&gt; Maybe Bool
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="../../base/src/GHC.Unicode.html#isPrint"><span class="hs-identifier hs-var">isPrint</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Char
</span><a href="#local-6989586621679099863"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-221"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FileOps -&gt; IO (Maybe Char)
</span><a href="System.Console.Haskeline.html#getPrintableChar"><span class="hs-identifier hs-var">getPrintableChar</span></a></span><span> </span><span class="annot"><span class="annottext">FileOps
</span><a href="#local-6989586621679099864"><span class="hs-identifier hs-var">fops</span></a></span><span>
</span><span id="line-222"></span><span>        </span><span class="annot"><span class="annottext">Maybe Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe Char -&gt; IO (Maybe Char)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Char
</span><a href="#local-6989586621679099863"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-223"></span><span>
</span><span id="line-224"></span><span id="local-6989586621679100184"><span class="annot"><a href="System.Console.Haskeline.html#getInputCmdChar"><span class="hs-identifier hs-type">getInputCmdChar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100184"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../exceptions/src/Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100184"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Term.html#TermOps"><span class="hs-identifier hs-type">TermOps</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Prefix"><span class="hs-identifier hs-type">Prefix</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#InputT"><span class="hs-identifier hs-type">InputT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100184"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span class="hs-special">)</span></span><span>
</span><span id="line-225"></span><span id="getInputCmdChar"><span class="annot"><span class="annottext">getInputCmdChar :: forall (m :: * -&gt; *).
(MonadIO m, MonadMask m) =&gt;
TermOps -&gt; Prefix -&gt; InputT m (Maybe Char)
</span><a href="System.Console.Haskeline.html#getInputCmdChar"><span class="hs-identifier hs-var hs-var">getInputCmdChar</span></a></span></span><span> </span><span id="local-6989586621679099848"><span class="annot"><span class="annottext">TermOps
</span><a href="#local-6989586621679099848"><span class="hs-identifier hs-var">tops</span></a></span></span><span> </span><span id="local-6989586621679099847"><span class="annot"><span class="annottext">Prefix
</span><a href="#local-6989586621679099847"><span class="hs-identifier hs-var">prefix</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TermOps -&gt; InputCmdT m (Maybe Char) -&gt; InputT m (Maybe Char)
forall (m :: * -&gt; *) a.
MonadIO m =&gt;
TermOps -&gt; InputCmdT m a -&gt; InputT m a
</span><a href="System.Console.Haskeline.InputT.html#runInputCmdT"><span class="hs-identifier hs-var">runInputCmdT</span></a></span><span> </span><span class="annot"><span class="annottext">TermOps
</span><a href="#local-6989586621679099848"><span class="hs-identifier hs-var">tops</span></a></span><span>
</span><span id="line-226"></span><span>        </span><span class="annot"><span class="annottext">(InputCmdT m (Maybe Char) -&gt; InputT m (Maybe Char))
-&gt; InputCmdT m (Maybe Char) -&gt; InputT m (Maybe Char)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">TermOps
-&gt; Prefix
-&gt; KeyCommand
     (StateT
        Layout
        (UndoT
           (StateT
              HistLog
              (ReaderT
                 (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
     InsertMode
     (Maybe Char)
-&gt; InsertMode
-&gt; InputCmdT m (Maybe Char)
forall (m :: * -&gt; *) s a.
(CommandMonad m, MonadState Layout m, LineState s) =&gt;
TermOps -&gt; Prefix -&gt; KeyCommand m s a -&gt; s -&gt; m a
</span><a href="System.Console.Haskeline.RunCommand.html#runCommandLoop"><span class="hs-identifier hs-var">runCommandLoop</span></a></span><span> </span><span class="annot"><span class="annottext">TermOps
</span><a href="#local-6989586621679099848"><span class="hs-identifier hs-var">tops</span></a></span><span> </span><span class="annot"><span class="annottext">Prefix
</span><a href="#local-6989586621679099847"><span class="hs-identifier hs-var">prefix</span></a></span><span> </span><span class="annot"><span class="annottext">KeyCommand
  (StateT
     Layout
     (UndoT
        (StateT
           HistLog
           (ReaderT
              (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
  InsertMode
  (Maybe Char)
forall (m :: * -&gt; *).
Monad m =&gt;
KeyCommand m InsertMode (Maybe Char)
</span><a href="System.Console.Haskeline.html#acceptOneChar"><span class="hs-identifier hs-var">acceptOneChar</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="System.Console.Haskeline.LineState.html#emptyIM"><span class="hs-identifier hs-var">emptyIM</span></a></span><span>
</span><span id="line-227"></span><span>
</span><span id="line-228"></span><span id="local-6989586621679100178"><span class="annot"><a href="System.Console.Haskeline.html#acceptOneChar"><span class="hs-identifier hs-type">acceptOneChar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100178"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Command.html#KeyCommand"><span class="hs-identifier hs-type">KeyCommand</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100178"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span class="hs-special">)</span></span><span>
</span><span id="line-229"></span><span id="acceptOneChar"><span class="annot"><span class="annottext">acceptOneChar :: forall (m :: * -&gt; *).
Monad m =&gt;
KeyCommand m InsertMode (Maybe Char)
</span><a href="System.Console.Haskeline.html#acceptOneChar"><span class="hs-identifier hs-var hs-var">acceptOneChar</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[KeyMap (Command m InsertMode (Maybe Char))]
-&gt; KeyMap (Command m InsertMode (Maybe Char))
forall a. [KeyMap a] -&gt; KeyMap a
</span><a href="System.Console.Haskeline.Command.html#choiceCmd"><span class="hs-identifier hs-var">choiceCmd</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">(Char -&gt; Command m InsertMode (Maybe Char))
-&gt; KeyMap (Command m InsertMode (Maybe Char))
forall (m :: * -&gt; *) s t.
(Char -&gt; Command m s t) -&gt; KeyCommand m s t
</span><a href="System.Console.Haskeline.Command.html#useChar"><span class="hs-identifier hs-var">useChar</span></a></span><span> </span><span class="annot"><span class="annottext">((Char -&gt; Command m InsertMode (Maybe Char))
 -&gt; KeyMap (Command m InsertMode (Maybe Char)))
-&gt; (Char -&gt; Command m InsertMode (Maybe Char))
-&gt; KeyMap (Command m InsertMode (Maybe Char))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679099834"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679099834"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621679099833"><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679099833"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(InsertMode -&gt; InsertMode) -&gt; Command m InsertMode InsertMode
forall t (m :: * -&gt; *) s.
(LineState t, Monad m) =&gt;
(s -&gt; t) -&gt; Command m s t
</span><a href="System.Console.Haskeline.Command.html#change"><span class="hs-identifier hs-var">change</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; InsertMode -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#insertChar"><span class="hs-identifier hs-var">insertChar</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679099834"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679099833"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-230"></span><span>                                                </span><span class="annot"><span class="annottext">CmdM m InsertMode -&gt; CmdM m (Maybe Char) -&gt; CmdM m (Maybe Char)
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Char -&gt; CmdM m (Maybe Char)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Maybe Char
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679099834"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-231"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Key
</span><a href="System.Console.Haskeline.Key.html#ctrlChar"><span class="hs-identifier hs-var">ctrlChar</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'l'</span></span><span> </span><span class="annot"><span class="annottext">Key
-&gt; Command m InsertMode (Maybe Char)
-&gt; KeyMap (Command m InsertMode (Maybe Char))
forall a. Key -&gt; a -&gt; KeyMap a
</span><a href="System.Console.Haskeline.Command.html#%2B%3E"><span class="hs-operator hs-var">+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Command m InsertMode InsertMode
forall (m :: * -&gt; *) s. Command m s s
</span><a href="System.Console.Haskeline.Command.html#clearScreenCmd"><span class="hs-identifier hs-var">clearScreenCmd</span></a></span><span> </span><span class="annot"><span class="annottext">Command m InsertMode InsertMode
-&gt; Command m InsertMode (Maybe Char)
-&gt; Command m InsertMode (Maybe Char)
forall (m :: * -&gt; *) s t u.
Monad m =&gt;
Command m s t -&gt; Command m t u -&gt; Command m s u
</span><a href="System.Console.Haskeline.Command.html#%3E%7C%3E"><span class="hs-operator hs-var">&gt;|&gt;</span></a></span><span>
</span><span id="line-232"></span><span>                                        </span><span class="annot"><span class="annottext">KeyMap (Command m InsertMode (Maybe Char))
-&gt; Command m InsertMode (Maybe Char)
forall (m :: * -&gt; *) s t. KeyCommand m s t -&gt; Command m s t
</span><a href="System.Console.Haskeline.Command.html#keyCommand"><span class="hs-identifier hs-var">keyCommand</span></a></span><span> </span><span class="annot"><span class="annottext">KeyMap (Command m InsertMode (Maybe Char))
forall (m :: * -&gt; *).
Monad m =&gt;
KeyCommand m InsertMode (Maybe Char)
</span><a href="System.Console.Haskeline.html#acceptOneChar"><span class="hs-identifier hs-var">acceptOneChar</span></a></span><span>
</span><span id="line-233"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Key
</span><a href="System.Console.Haskeline.Key.html#ctrlChar"><span class="hs-identifier hs-var">ctrlChar</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'d'</span></span><span> </span><span class="annot"><span class="annottext">Key
-&gt; Command m InsertMode (Maybe Char)
-&gt; KeyMap (Command m InsertMode (Maybe Char))
forall a. Key -&gt; a -&gt; KeyMap a
</span><a href="System.Console.Haskeline.Command.html#%2B%3E"><span class="hs-operator hs-var">+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Command m InsertMode (Maybe Char)
forall (m :: * -&gt; *) s a. Monad m =&gt; Command m s (Maybe a)
</span><a href="System.Console.Haskeline.Command.html#failCmd"><span class="hs-identifier hs-var">failCmd</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-234"></span><span>
</span><span id="line-235"></span><span class="hs-comment">----------</span><span>
</span><span id="line-236"></span><span class="hs-comment">{- | Waits for one key to be pressed, then returns.  Ignores the value
of the specific key.

Returns 'True' if it successfully accepted one key.  Returns 'False'
if it encountered the end of input; i.e., an @EOF@ in file-style interaction,
or a @Ctrl-D@ in terminal-style interaction.

When using file-style interaction, consumes a single character from the input which may
be non-printable.
-}</span><span>
</span><span id="line-246"></span><span id="local-6989586621679100149"><span class="annot"><a href="System.Console.Haskeline.html#waitForAnyKey"><span class="hs-identifier hs-type">waitForAnyKey</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100149"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../exceptions/src/Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100149"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-247"></span><span>    </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-comment">-- ^ The input prompt</span><span>
</span><span id="line-248"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#InputT"><span class="hs-identifier hs-type">InputT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100149"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span></span><span>
</span><span id="line-249"></span><span id="waitForAnyKey"><span class="annot"><span class="annottext">waitForAnyKey :: forall (m :: * -&gt; *).
(MonadIO m, MonadMask m) =&gt;
FilePath -&gt; InputT m Bool
</span><a href="System.Console.Haskeline.html#waitForAnyKey"><span class="hs-identifier hs-var hs-var">waitForAnyKey</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TermOps -&gt; Prefix -&gt; InputT m Bool)
-&gt; (FileOps -&gt; IO Bool) -&gt; FilePath -&gt; InputT m Bool
forall (m :: * -&gt; *) a.
MonadIO m =&gt;
(TermOps -&gt; Prefix -&gt; InputT m a)
-&gt; (FileOps -&gt; IO a) -&gt; FilePath -&gt; InputT m a
</span><a href="System.Console.Haskeline.html#promptedInput"><span class="hs-identifier hs-var">promptedInput</span></a></span><span> </span><span class="annot"><span class="annottext">TermOps -&gt; Prefix -&gt; InputT m Bool
forall (m :: * -&gt; *).
(MonadIO m, MonadMask m) =&gt;
TermOps -&gt; Prefix -&gt; InputT m Bool
</span><a href="System.Console.Haskeline.html#getAnyKeyCmd"><span class="hs-identifier hs-var">getAnyKeyCmd</span></a></span><span>
</span><span id="line-250"></span><span>            </span><span class="annot"><span class="annottext">((FileOps -&gt; IO Bool) -&gt; FilePath -&gt; InputT m Bool)
-&gt; (FileOps -&gt; IO Bool) -&gt; FilePath -&gt; InputT m Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679099816"><span class="annot"><span class="annottext">FileOps
</span><a href="#local-6989586621679099816"><span class="hs-identifier hs-var">fops</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Maybe Char -&gt; Bool) -&gt; IO (Maybe Char) -&gt; IO Bool
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Char -&gt; Bool
forall a. Maybe a -&gt; Bool
</span><a href="../../base/src/Data.Maybe.html#isJust"><span class="hs-identifier hs-var">isJust</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Maybe Char) -&gt; IO Bool)
-&gt; (MaybeT IO Char -&gt; IO (Maybe Char)) -&gt; MaybeT IO Char -&gt; IO Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">MaybeT IO Char -&gt; IO (Maybe Char)
forall (m :: * -&gt; *) a. MaybeT m a -&gt; m (Maybe a)
</span><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#runMaybeT"><span class="hs-identifier hs-var hs-var">runMaybeT</span></a></span><span> </span><span class="annot"><span class="annottext">(MaybeT IO Char -&gt; IO Bool) -&gt; MaybeT IO Char -&gt; IO Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FileOps -&gt; MaybeT IO Char
</span><a href="System.Console.Haskeline.Term.html#getLocaleChar"><span class="hs-identifier hs-var hs-var">getLocaleChar</span></a></span><span> </span><span class="annot"><span class="annottext">FileOps
</span><a href="#local-6989586621679099816"><span class="hs-identifier hs-var">fops</span></a></span><span>
</span><span id="line-251"></span><span>
</span><span id="line-252"></span><span id="local-6989586621679100147"><span class="annot"><a href="System.Console.Haskeline.html#getAnyKeyCmd"><span class="hs-identifier hs-type">getAnyKeyCmd</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100147"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../exceptions/src/Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100147"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Term.html#TermOps"><span class="hs-identifier hs-type">TermOps</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Prefix"><span class="hs-identifier hs-type">Prefix</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#InputT"><span class="hs-identifier hs-type">InputT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100147"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span></span><span>
</span><span id="line-253"></span><span id="getAnyKeyCmd"><span class="annot"><span class="annottext">getAnyKeyCmd :: forall (m :: * -&gt; *).
(MonadIO m, MonadMask m) =&gt;
TermOps -&gt; Prefix -&gt; InputT m Bool
</span><a href="System.Console.Haskeline.html#getAnyKeyCmd"><span class="hs-identifier hs-var hs-var">getAnyKeyCmd</span></a></span></span><span> </span><span id="local-6989586621679099803"><span class="annot"><span class="annottext">TermOps
</span><a href="#local-6989586621679099803"><span class="hs-identifier hs-var">tops</span></a></span></span><span> </span><span id="local-6989586621679099802"><span class="annot"><span class="annottext">Prefix
</span><a href="#local-6989586621679099802"><span class="hs-identifier hs-var">prefix</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TermOps -&gt; InputCmdT m Bool -&gt; InputT m Bool
forall (m :: * -&gt; *) a.
MonadIO m =&gt;
TermOps -&gt; InputCmdT m a -&gt; InputT m a
</span><a href="System.Console.Haskeline.InputT.html#runInputCmdT"><span class="hs-identifier hs-var">runInputCmdT</span></a></span><span> </span><span class="annot"><span class="annottext">TermOps
</span><a href="#local-6989586621679099803"><span class="hs-identifier hs-var">tops</span></a></span><span>
</span><span id="line-254"></span><span>    </span><span class="annot"><span class="annottext">(InputCmdT m Bool -&gt; InputT m Bool)
-&gt; InputCmdT m Bool -&gt; InputT m Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">TermOps
-&gt; Prefix
-&gt; KeyCommand
     (StateT
        Layout
        (UndoT
           (StateT
              HistLog
              (ReaderT
                 (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
     InsertMode
     Bool
-&gt; InsertMode
-&gt; InputCmdT m Bool
forall (m :: * -&gt; *) s a.
(CommandMonad m, MonadState Layout m, LineState s) =&gt;
TermOps -&gt; Prefix -&gt; KeyCommand m s a -&gt; s -&gt; m a
</span><a href="System.Console.Haskeline.RunCommand.html#runCommandLoop"><span class="hs-identifier hs-var">runCommandLoop</span></a></span><span> </span><span class="annot"><span class="annottext">TermOps
</span><a href="#local-6989586621679099803"><span class="hs-identifier hs-var">tops</span></a></span><span> </span><span class="annot"><span class="annottext">Prefix
</span><a href="#local-6989586621679099802"><span class="hs-identifier hs-var">prefix</span></a></span><span> </span><span class="annot"><span class="annottext">KeyCommand
  (StateT
     Layout
     (UndoT
        (StateT
           HistLog
           (ReaderT
              (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
  InsertMode
  Bool
forall {b}.
KeyMap
  (b
   -&gt; CmdM
        (StateT
           Layout
           (UndoT
              (StateT
                 HistLog
                 (ReaderT
                    (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
        Bool)
</span><a href="#local-6989586621679099801"><span class="hs-identifier hs-var">acceptAnyChar</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="System.Console.Haskeline.LineState.html#emptyIM"><span class="hs-identifier hs-var">emptyIM</span></a></span><span>
</span><span id="line-255"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-256"></span><span>    </span><span id="local-6989586621679099801"><span class="annot"><span class="annottext">acceptAnyChar :: KeyMap
  (b
   -&gt; CmdM
        (StateT
           Layout
           (UndoT
              (StateT
                 HistLog
                 (ReaderT
                    (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
        Bool)
</span><a href="#local-6989586621679099801"><span class="hs-identifier hs-var hs-var">acceptAnyChar</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[KeyMap
   (b
    -&gt; CmdM
         (StateT
            Layout
            (UndoT
               (StateT
                  HistLog
                  (ReaderT
                     (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
         Bool)]
-&gt; KeyMap
     (b
      -&gt; CmdM
           (StateT
              Layout
              (UndoT
                 (StateT
                    HistLog
                    (ReaderT
                       (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
           Bool)
forall a. [KeyMap a] -&gt; KeyMap a
</span><a href="System.Console.Haskeline.Command.html#choiceCmd"><span class="hs-identifier hs-var">choiceCmd</span></a></span><span>
</span><span id="line-257"></span><span>                </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Key
</span><a href="System.Console.Haskeline.Key.html#ctrlChar"><span class="hs-identifier hs-var">ctrlChar</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'d'</span></span><span> </span><span class="annot"><span class="annottext">Key
-&gt; (b
    -&gt; CmdM
         (StateT
            Layout
            (UndoT
               (StateT
                  HistLog
                  (ReaderT
                     (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
         Bool)
-&gt; KeyMap
     (b
      -&gt; CmdM
           (StateT
              Layout
              (UndoT
                 (StateT
                    HistLog
                    (ReaderT
                       (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
           Bool)
forall a. Key -&gt; a -&gt; KeyMap a
</span><a href="System.Console.Haskeline.Command.html#%2B%3E"><span class="hs-operator hs-var">+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">CmdM
  (StateT
     Layout
     (UndoT
        (StateT
           HistLog
           (ReaderT
              (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
  Bool
-&gt; b
-&gt; CmdM
     (StateT
        Layout
        (UndoT
           (StateT
              HistLog
              (ReaderT
                 (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
     Bool
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool
-&gt; CmdM
     (StateT
        Layout
        (UndoT
           (StateT
              HistLog
              (ReaderT
                 (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
     Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">)</span><span>
</span><span id="line-258"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(Key
 -&gt; Maybe
      (KeyConsumed
         (b
          -&gt; CmdM
               (StateT
                  Layout
                  (UndoT
                     (StateT
                        HistLog
                        (ReaderT
                           (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
               Bool)))
-&gt; KeyMap
     (b
      -&gt; CmdM
           (StateT
              Layout
              (UndoT
                 (StateT
                    HistLog
                    (ReaderT
                       (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
           Bool)
forall a. (Key -&gt; Maybe (KeyConsumed a)) -&gt; KeyMap a
</span><a href="System.Console.Haskeline.Command.html#KeyMap"><span class="hs-identifier hs-var">KeyMap</span></a></span><span> </span><span class="annot"><span class="annottext">((Key
  -&gt; Maybe
       (KeyConsumed
          (b
           -&gt; CmdM
                (StateT
                   Layout
                   (UndoT
                      (StateT
                         HistLog
                         (ReaderT
                            (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
                Bool)))
 -&gt; KeyMap
      (b
       -&gt; CmdM
            (StateT
               Layout
               (UndoT
                  (StateT
                     HistLog
                     (ReaderT
                        (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
            Bool))
-&gt; (Key
    -&gt; Maybe
         (KeyConsumed
            (b
             -&gt; CmdM
                  (StateT
                     Layout
                     (UndoT
                        (StateT
                           HistLog
                           (ReaderT
                              (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
                  Bool)))
-&gt; KeyMap
     (b
      -&gt; CmdM
           (StateT
              Layout
              (UndoT
                 (StateT
                    HistLog
                    (ReaderT
                       (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
           Bool)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe
  (KeyConsumed
     (b
      -&gt; CmdM
           (StateT
              Layout
              (UndoT
                 (StateT
                    HistLog
                    (ReaderT
                       (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
           Bool))
-&gt; Key
-&gt; Maybe
     (KeyConsumed
        (b
         -&gt; CmdM
              (StateT
                 Layout
                 (UndoT
                    (StateT
                       HistLog
                       (ReaderT
                          (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
              Bool))
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe
   (KeyConsumed
      (b
       -&gt; CmdM
            (StateT
               Layout
               (UndoT
                  (StateT
                     HistLog
                     (ReaderT
                        (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
            Bool))
 -&gt; Key
 -&gt; Maybe
      (KeyConsumed
         (b
          -&gt; CmdM
               (StateT
                  Layout
                  (UndoT
                     (StateT
                        HistLog
                        (ReaderT
                           (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
               Bool)))
-&gt; Maybe
     (KeyConsumed
        (b
         -&gt; CmdM
              (StateT
                 Layout
                 (UndoT
                    (StateT
                       HistLog
                       (ReaderT
                          (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
              Bool))
-&gt; Key
-&gt; Maybe
     (KeyConsumed
        (b
         -&gt; CmdM
              (StateT
                 Layout
                 (UndoT
                    (StateT
                       HistLog
                       (ReaderT
                          (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
              Bool))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">KeyConsumed
  (b
   -&gt; CmdM
        (StateT
           Layout
           (UndoT
              (StateT
                 HistLog
                 (ReaderT
                    (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
        Bool)
-&gt; Maybe
     (KeyConsumed
        (b
         -&gt; CmdM
              (StateT
                 Layout
                 (UndoT
                    (StateT
                       HistLog
                       (ReaderT
                          (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
              Bool))
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(b
 -&gt; CmdM
      (StateT
         Layout
         (UndoT
            (StateT
               HistLog
               (ReaderT
                  (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
      Bool)
-&gt; KeyConsumed
     (b
      -&gt; CmdM
           (StateT
              Layout
              (UndoT
                 (StateT
                    HistLog
                    (ReaderT
                       (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
           Bool)
forall a. a -&gt; KeyConsumed a
</span><a href="System.Console.Haskeline.Command.html#Consumed"><span class="hs-identifier hs-var">Consumed</span></a></span><span> </span><span class="annot"><span class="annottext">((b
  -&gt; CmdM
       (StateT
          Layout
          (UndoT
             (StateT
                HistLog
                (ReaderT
                   (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
       Bool)
 -&gt; KeyConsumed
      (b
       -&gt; CmdM
            (StateT
               Layout
               (UndoT
                  (StateT
                     HistLog
                     (ReaderT
                        (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
            Bool))
-&gt; (b
    -&gt; CmdM
         (StateT
            Layout
            (UndoT
               (StateT
                  HistLog
                  (ReaderT
                     (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
         Bool)
-&gt; KeyConsumed
     (b
      -&gt; CmdM
           (StateT
              Layout
              (UndoT
                 (StateT
                    HistLog
                    (ReaderT
                       (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
           Bool)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CmdM
  (StateT
     Layout
     (UndoT
        (StateT
           HistLog
           (ReaderT
              (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
  Bool
-&gt; b
-&gt; CmdM
     (StateT
        Layout
        (UndoT
           (StateT
              HistLog
              (ReaderT
                 (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
     Bool
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">(CmdM
   (StateT
      Layout
      (UndoT
         (StateT
            HistLog
            (ReaderT
               (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
   Bool
 -&gt; b
 -&gt; CmdM
      (StateT
         Layout
         (UndoT
            (StateT
               HistLog
               (ReaderT
                  (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
      Bool)
-&gt; CmdM
     (StateT
        Layout
        (UndoT
           (StateT
              HistLog
              (ReaderT
                 (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
     Bool
-&gt; b
-&gt; CmdM
     (StateT
        Layout
        (UndoT
           (StateT
              HistLog
              (ReaderT
                 (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
     Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
-&gt; CmdM
     (StateT
        Layout
        (UndoT
           (StateT
              HistLog
              (ReaderT
                 (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
     Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">)</span><span>
</span><span id="line-259"></span><span>                </span><span class="hs-special">]</span><span>
</span><span id="line-260"></span><span>
</span><span id="line-261"></span><span class="hs-comment">----------</span><span>
</span><span id="line-262"></span><span class="hs-comment">-- Passwords</span><span>
</span><span id="line-263"></span><span>
</span><span id="line-264"></span><span class="hs-comment">{- | Reads one line of input, without displaying the input while it is being typed.
When using terminal-style interaction, the masking character (if given) will replace each typed character.

When using file-style interaction, this function turns off echoing while reading
the line of input.

Note that if Haskeline is built against a version of the @Win32@ library
earlier than 2.5, 'getPassword' will incorrectly echo back input on MinTTY
consoles (such as Cygwin or MSYS).
-}</span><span>
</span><span id="line-274"></span><span>
</span><span id="line-275"></span><span id="local-6989586621679100138"><span class="annot"><a href="System.Console.Haskeline.html#getPassword"><span class="hs-identifier hs-type">getPassword</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100138"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../exceptions/src/Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100138"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-comment">-- ^ A masking character; e.g., @Just \'*\'@</span><span>
</span><span id="line-276"></span><span>                            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#InputT"><span class="hs-identifier hs-type">InputT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100138"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-277"></span><span id="getPassword"><span class="annot"><span class="annottext">getPassword :: forall (m :: * -&gt; *).
(MonadIO m, MonadMask m) =&gt;
Maybe Char -&gt; FilePath -&gt; InputT m (Maybe FilePath)
</span><a href="System.Console.Haskeline.html#getPassword"><span class="hs-identifier hs-var hs-var">getPassword</span></a></span></span><span> </span><span id="local-6989586621679099776"><span class="annot"><span class="annottext">Maybe Char
</span><a href="#local-6989586621679099776"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TermOps -&gt; Prefix -&gt; InputT m (Maybe FilePath))
-&gt; (FileOps -&gt; IO (Maybe FilePath))
-&gt; FilePath
-&gt; InputT m (Maybe FilePath)
forall (m :: * -&gt; *) a.
MonadIO m =&gt;
(TermOps -&gt; Prefix -&gt; InputT m a)
-&gt; (FileOps -&gt; IO a) -&gt; FilePath -&gt; InputT m a
</span><a href="System.Console.Haskeline.html#promptedInput"><span class="hs-identifier hs-var">promptedInput</span></a></span><span>
</span><span id="line-278"></span><span>                    </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679099775"><span class="annot"><span class="annottext">TermOps
</span><a href="#local-6989586621679099775"><span class="hs-identifier hs-var">tops</span></a></span></span><span> </span><span id="local-6989586621679099774"><span class="annot"><span class="annottext">Prefix
</span><a href="#local-6989586621679099774"><span class="hs-identifier hs-var">prefix</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TermOps
-&gt; InputCmdT m (Maybe FilePath) -&gt; InputT m (Maybe FilePath)
forall (m :: * -&gt; *) a.
MonadIO m =&gt;
TermOps -&gt; InputCmdT m a -&gt; InputT m a
</span><a href="System.Console.Haskeline.InputT.html#runInputCmdT"><span class="hs-identifier hs-var">runInputCmdT</span></a></span><span> </span><span class="annot"><span class="annottext">TermOps
</span><a href="#local-6989586621679099775"><span class="hs-identifier hs-var">tops</span></a></span><span>
</span><span id="line-279"></span><span>                                        </span><span class="annot"><span class="annottext">(InputCmdT m (Maybe FilePath) -&gt; InputT m (Maybe FilePath))
-&gt; InputCmdT m (Maybe FilePath) -&gt; InputT m (Maybe FilePath)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">TermOps
-&gt; Prefix
-&gt; KeyCommand
     (StateT
        Layout
        (UndoT
           (StateT
              HistLog
              (ReaderT
                 (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
     Password
     (Maybe FilePath)
-&gt; Password
-&gt; InputCmdT m (Maybe FilePath)
forall (m :: * -&gt; *) s a.
(CommandMonad m, MonadState Layout m, LineState s) =&gt;
TermOps -&gt; Prefix -&gt; KeyCommand m s a -&gt; s -&gt; m a
</span><a href="System.Console.Haskeline.RunCommand.html#runCommandLoop"><span class="hs-identifier hs-var">runCommandLoop</span></a></span><span> </span><span class="annot"><span class="annottext">TermOps
</span><a href="#local-6989586621679099775"><span class="hs-identifier hs-var">tops</span></a></span><span> </span><span class="annot"><span class="annottext">Prefix
</span><a href="#local-6989586621679099774"><span class="hs-identifier hs-var">prefix</span></a></span><span> </span><span class="annot"><span class="annottext">KeyCommand
  (StateT
     Layout
     (UndoT
        (StateT
           HistLog
           (ReaderT
              (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
  Password
  (Maybe FilePath)
</span><a href="#local-6989586621679099773"><span class="hs-identifier hs-var">loop</span></a></span><span>
</span><span id="line-280"></span><span>                                        </span><span class="annot"><span class="annottext">(Password -&gt; InputCmdT m (Maybe FilePath))
-&gt; Password -&gt; InputCmdT m (Maybe FilePath)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; Maybe Char -&gt; Password
</span><a href="System.Console.Haskeline.LineState.html#Password"><span class="hs-identifier hs-var">Password</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Maybe Char
</span><a href="#local-6989586621679099776"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-281"></span><span>                    </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679099771"><span class="annot"><span class="annottext">FileOps
</span><a href="#local-6989586621679099771"><span class="hs-identifier hs-var">fops</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FileOps
-&gt; forall (m :: * -&gt; *) a. (MonadIO m, MonadMask m) =&gt; m a -&gt; m a
</span><a href="System.Console.Haskeline.Term.html#withoutInputEcho"><span class="hs-identifier hs-var hs-var">withoutInputEcho</span></a></span><span> </span><span class="annot"><span class="annottext">FileOps
</span><a href="#local-6989586621679099771"><span class="hs-identifier hs-var">fops</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Maybe FilePath) -&gt; IO (Maybe FilePath))
-&gt; IO (Maybe FilePath) -&gt; IO (Maybe FilePath)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">MaybeT IO FilePath -&gt; IO (Maybe FilePath)
forall (m :: * -&gt; *) a. MaybeT m a -&gt; m (Maybe a)
</span><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#runMaybeT"><span class="hs-identifier hs-var hs-var">runMaybeT</span></a></span><span> </span><span class="annot"><span class="annottext">(MaybeT IO FilePath -&gt; IO (Maybe FilePath))
-&gt; MaybeT IO FilePath -&gt; IO (Maybe FilePath)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FileOps -&gt; MaybeT IO FilePath
</span><a href="System.Console.Haskeline.Term.html#getLocaleLine"><span class="hs-identifier hs-var hs-var">getLocaleLine</span></a></span><span> </span><span class="annot"><span class="annottext">FileOps
</span><a href="#local-6989586621679099771"><span class="hs-identifier hs-var">fops</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-282"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-283"></span><span>    </span><span id="local-6989586621679099773"><span class="annot"><span class="annottext">loop :: KeyCommand
  (StateT
     Layout
     (UndoT
        (StateT
           HistLog
           (ReaderT
              (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
  Password
  (Maybe FilePath)
</span><a href="#local-6989586621679099773"><span class="hs-identifier hs-var hs-var">loop</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[KeyCommand
   (StateT
      Layout
      (UndoT
         (StateT
            HistLog
            (ReaderT
               (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
   Password
   (Maybe FilePath)]
-&gt; KeyCommand
     (StateT
        Layout
        (UndoT
           (StateT
              HistLog
              (ReaderT
                 (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
     Password
     (Maybe FilePath)
forall a. [KeyMap a] -&gt; KeyMap a
</span><a href="System.Console.Haskeline.Command.html#choiceCmd"><span class="hs-identifier hs-var">choiceCmd</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Key
</span><a href="System.Console.Haskeline.Key.html#simpleChar"><span class="hs-identifier hs-var">simpleChar</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\n'</span></span><span> </span><span class="annot"><span class="annottext">Key
-&gt; Command
     (StateT
        Layout
        (UndoT
           (StateT
              HistLog
              (ReaderT
                 (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
     Password
     (Maybe FilePath)
-&gt; KeyCommand
     (StateT
        Layout
        (UndoT
           (StateT
              HistLog
              (ReaderT
                 (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
     Password
     (Maybe FilePath)
forall a. Key -&gt; a -&gt; KeyMap a
</span><a href="System.Console.Haskeline.Command.html#%2B%3E"><span class="hs-operator hs-var">+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Command
  (StateT
     Layout
     (UndoT
        (StateT
           HistLog
           (ReaderT
              (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
  Password
  (Maybe FilePath)
forall (m :: * -&gt; *) s.
(Monad m, Result s) =&gt;
Command m s (Maybe FilePath)
</span><a href="System.Console.Haskeline.Command.html#finish"><span class="hs-identifier hs-var">finish</span></a></span><span>
</span><span id="line-284"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">BaseKey -&gt; Key
</span><a href="System.Console.Haskeline.Key.html#simpleKey"><span class="hs-identifier hs-var">simpleKey</span></a></span><span> </span><span class="annot"><span class="annottext">BaseKey
</span><a href="System.Console.Haskeline.Key.html#Backspace"><span class="hs-identifier hs-var">Backspace</span></a></span><span> </span><span class="annot"><span class="annottext">Key
-&gt; Command
     (StateT
        Layout
        (UndoT
           (StateT
              HistLog
              (ReaderT
                 (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
     Password
     (Maybe FilePath)
-&gt; KeyCommand
     (StateT
        Layout
        (UndoT
           (StateT
              HistLog
              (ReaderT
                 (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
     Password
     (Maybe FilePath)
forall a. Key -&gt; a -&gt; KeyMap a
</span><a href="System.Console.Haskeline.Command.html#%2B%3E"><span class="hs-operator hs-var">+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">(Password -&gt; Password)
-&gt; Command
     (StateT
        Layout
        (UndoT
           (StateT
              HistLog
              (ReaderT
                 (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
     Password
     Password
forall t (m :: * -&gt; *) s.
(LineState t, Monad m) =&gt;
(s -&gt; t) -&gt; Command m s t
</span><a href="System.Console.Haskeline.Command.html#change"><span class="hs-identifier hs-var">change</span></a></span><span> </span><span class="annot"><span class="annottext">Password -&gt; Password
</span><a href="System.Console.Haskeline.LineState.html#deletePasswordChar"><span class="hs-identifier hs-var">deletePasswordChar</span></a></span><span>
</span><span id="line-285"></span><span>                                                </span><span class="annot"><span class="annottext">Command
  (StateT
     Layout
     (UndoT
        (StateT
           HistLog
           (ReaderT
              (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
  Password
  Password
-&gt; Command
     (StateT
        Layout
        (UndoT
           (StateT
              HistLog
              (ReaderT
                 (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
     Password
     (Maybe FilePath)
-&gt; Command
     (StateT
        Layout
        (UndoT
           (StateT
              HistLog
              (ReaderT
                 (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
     Password
     (Maybe FilePath)
forall (m :: * -&gt; *) s t u.
Monad m =&gt;
Command m s t -&gt; Command m t u -&gt; Command m s u
</span><a href="System.Console.Haskeline.Command.html#%3E%7C%3E"><span class="hs-operator hs-var">&gt;|&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Command
  (StateT
     Layout
     (UndoT
        (StateT
           HistLog
           (ReaderT
              (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
  Password
  (Maybe FilePath)
</span><a href="#local-6989586621679099750"><span class="hs-identifier hs-var">loop'</span></a></span><span>
</span><span id="line-286"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(Char
 -&gt; Command
      (StateT
         Layout
         (UndoT
            (StateT
               HistLog
               (ReaderT
                  (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
      Password
      (Maybe FilePath))
-&gt; KeyCommand
     (StateT
        Layout
        (UndoT
           (StateT
              HistLog
              (ReaderT
                 (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
     Password
     (Maybe FilePath)
forall (m :: * -&gt; *) s t.
(Char -&gt; Command m s t) -&gt; KeyCommand m s t
</span><a href="System.Console.Haskeline.Command.html#useChar"><span class="hs-identifier hs-var">useChar</span></a></span><span> </span><span class="annot"><span class="annottext">((Char
  -&gt; Command
       (StateT
          Layout
          (UndoT
             (StateT
                HistLog
                (ReaderT
                   (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
       Password
       (Maybe FilePath))
 -&gt; KeyCommand
      (StateT
         Layout
         (UndoT
            (StateT
               HistLog
               (ReaderT
                  (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
      Password
      (Maybe FilePath))
-&gt; (Char
    -&gt; Command
         (StateT
            Layout
            (UndoT
               (StateT
                  HistLog
                  (ReaderT
                     (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
         Password
         (Maybe FilePath))
-&gt; KeyCommand
     (StateT
        Layout
        (UndoT
           (StateT
              HistLog
              (ReaderT
                 (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
     Password
     (Maybe FilePath)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679099749"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679099749"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Password -&gt; Password)
-&gt; Command
     (StateT
        Layout
        (UndoT
           (StateT
              HistLog
              (ReaderT
                 (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
     Password
     Password
forall t (m :: * -&gt; *) s.
(LineState t, Monad m) =&gt;
(s -&gt; t) -&gt; Command m s t
</span><a href="System.Console.Haskeline.Command.html#change"><span class="hs-identifier hs-var">change</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Password -&gt; Password
</span><a href="System.Console.Haskeline.LineState.html#addPasswordChar"><span class="hs-identifier hs-var">addPasswordChar</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679099749"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Command
  (StateT
     Layout
     (UndoT
        (StateT
           HistLog
           (ReaderT
              (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
  Password
  Password
-&gt; Command
     (StateT
        Layout
        (UndoT
           (StateT
              HistLog
              (ReaderT
                 (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
     Password
     (Maybe FilePath)
-&gt; Command
     (StateT
        Layout
        (UndoT
           (StateT
              HistLog
              (ReaderT
                 (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
     Password
     (Maybe FilePath)
forall (m :: * -&gt; *) s t u.
Monad m =&gt;
Command m s t -&gt; Command m t u -&gt; Command m s u
</span><a href="System.Console.Haskeline.Command.html#%3E%7C%3E"><span class="hs-operator hs-var">&gt;|&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Command
  (StateT
     Layout
     (UndoT
        (StateT
           HistLog
           (ReaderT
              (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
  Password
  (Maybe FilePath)
</span><a href="#local-6989586621679099750"><span class="hs-identifier hs-var">loop'</span></a></span><span>
</span><span id="line-287"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Key
</span><a href="System.Console.Haskeline.Key.html#ctrlChar"><span class="hs-identifier hs-var">ctrlChar</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'d'</span></span><span> </span><span class="annot"><span class="annottext">Key
-&gt; Command
     (StateT
        Layout
        (UndoT
           (StateT
              HistLog
              (ReaderT
                 (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
     Password
     (Maybe FilePath)
-&gt; KeyCommand
     (StateT
        Layout
        (UndoT
           (StateT
              HistLog
              (ReaderT
                 (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
     Password
     (Maybe FilePath)
forall a. Key -&gt; a -&gt; KeyMap a
</span><a href="System.Console.Haskeline.Command.html#%2B%3E"><span class="hs-operator hs-var">+&gt;</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679099747"><span class="annot"><span class="annottext">Password
</span><a href="#local-6989586621679099747"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Password -&gt; FilePath
</span><a href="System.Console.Haskeline.LineState.html#passwordState"><span class="hs-identifier hs-var hs-var">passwordState</span></a></span><span> </span><span class="annot"><span class="annottext">Password
</span><a href="#local-6989586621679099747"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-288"></span><span>                                                </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Command
  (StateT
     Layout
     (UndoT
        (StateT
           HistLog
           (ReaderT
              (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
  Password
  (Maybe FilePath)
forall (m :: * -&gt; *) s a. Monad m =&gt; Command m s (Maybe a)
</span><a href="System.Console.Haskeline.Command.html#failCmd"><span class="hs-identifier hs-var">failCmd</span></a></span><span> </span><span class="annot"><span class="annottext">Password
</span><a href="#local-6989586621679099747"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-289"></span><span>                                                </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Command
  (StateT
     Layout
     (UndoT
        (StateT
           HistLog
           (ReaderT
              (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
  Password
  (Maybe FilePath)
forall (m :: * -&gt; *) s.
(Monad m, Result s) =&gt;
Command m s (Maybe FilePath)
</span><a href="System.Console.Haskeline.Command.html#finish"><span class="hs-identifier hs-var">finish</span></a></span><span> </span><span class="annot"><span class="annottext">Password
</span><a href="#local-6989586621679099747"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-290"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Key
</span><a href="System.Console.Haskeline.Key.html#ctrlChar"><span class="hs-identifier hs-var">ctrlChar</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'l'</span></span><span> </span><span class="annot"><span class="annottext">Key
-&gt; Command
     (StateT
        Layout
        (UndoT
           (StateT
              HistLog
              (ReaderT
                 (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
     Password
     (Maybe FilePath)
-&gt; KeyCommand
     (StateT
        Layout
        (UndoT
           (StateT
              HistLog
              (ReaderT
                 (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
     Password
     (Maybe FilePath)
forall a. Key -&gt; a -&gt; KeyMap a
</span><a href="System.Console.Haskeline.Command.html#%2B%3E"><span class="hs-operator hs-var">+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Command
  (StateT
     Layout
     (UndoT
        (StateT
           HistLog
           (ReaderT
              (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
  Password
  Password
forall (m :: * -&gt; *) s. Command m s s
</span><a href="System.Console.Haskeline.Command.html#clearScreenCmd"><span class="hs-identifier hs-var">clearScreenCmd</span></a></span><span> </span><span class="annot"><span class="annottext">Command
  (StateT
     Layout
     (UndoT
        (StateT
           HistLog
           (ReaderT
              (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
  Password
  Password
-&gt; Command
     (StateT
        Layout
        (UndoT
           (StateT
              HistLog
              (ReaderT
                 (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
     Password
     (Maybe FilePath)
-&gt; Command
     (StateT
        Layout
        (UndoT
           (StateT
              HistLog
              (ReaderT
                 (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
     Password
     (Maybe FilePath)
forall (m :: * -&gt; *) s t u.
Monad m =&gt;
Command m s t -&gt; Command m t u -&gt; Command m s u
</span><a href="System.Console.Haskeline.Command.html#%3E%7C%3E"><span class="hs-operator hs-var">&gt;|&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Command
  (StateT
     Layout
     (UndoT
        (StateT
           HistLog
           (ReaderT
              (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
  Password
  (Maybe FilePath)
</span><a href="#local-6989586621679099750"><span class="hs-identifier hs-var">loop'</span></a></span><span>
</span><span id="line-291"></span><span>                     </span><span class="hs-special">]</span><span>
</span><span id="line-292"></span><span>    </span><span id="local-6989586621679099750"><span class="annot"><span class="annottext">loop' :: Command
  (StateT
     Layout
     (UndoT
        (StateT
           HistLog
           (ReaderT
              (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
  Password
  (Maybe FilePath)
</span><a href="#local-6989586621679099750"><span class="hs-identifier hs-var hs-var">loop'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">KeyCommand
  (StateT
     Layout
     (UndoT
        (StateT
           HistLog
           (ReaderT
              (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
  Password
  (Maybe FilePath)
-&gt; Command
     (StateT
        Layout
        (UndoT
           (StateT
              HistLog
              (ReaderT
                 (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
     Password
     (Maybe FilePath)
forall (m :: * -&gt; *) s t. KeyCommand m s t -&gt; Command m s t
</span><a href="System.Console.Haskeline.Command.html#keyCommand"><span class="hs-identifier hs-var">keyCommand</span></a></span><span> </span><span class="annot"><span class="annottext">KeyCommand
  (StateT
     Layout
     (UndoT
        (StateT
           HistLog
           (ReaderT
              (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))))
  Password
  (Maybe FilePath)
</span><a href="#local-6989586621679099773"><span class="hs-identifier hs-var">loop</span></a></span><span>
</span><span id="line-293"></span><span>
</span><span id="line-294"></span><span class="hs-comment">{- $history
The 'InputT' monad transformer provides direct, low-level access to the user's line history state.

However, for most applications, it should suffice to just use the 'autoAddHistory'
and 'historyFile' flags.

-}</span><span>
</span><span id="line-301"></span><span>
</span><span id="line-302"></span><span>
</span><span id="line-303"></span><span class="hs-comment">-------</span><span>
</span><span id="line-304"></span><span class="hs-comment">-- | Wrapper for input functions.</span><span>
</span><span id="line-305"></span><span class="hs-comment">-- This is the function that calls &quot;wrapFileInput&quot; around file backend input</span><span>
</span><span id="line-306"></span><span class="hs-comment">-- functions (see Term.hs).</span><span>
</span><span id="line-307"></span><span id="local-6989586621679100256"><span id="local-6989586621679100257"><span class="annot"><a href="System.Console.Haskeline.html#promptedInput"><span class="hs-identifier hs-type">promptedInput</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100257"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.Term.html#TermOps"><span class="hs-identifier hs-type">TermOps</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#Prefix"><span class="hs-identifier hs-type">Prefix</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#InputT"><span class="hs-identifier hs-type">InputT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100257"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100256"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-308"></span><span>                        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.Term.html#FileOps"><span class="hs-identifier hs-type">FileOps</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679100256"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-309"></span><span>                        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#InputT"><span class="hs-identifier hs-type">InputT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100257"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100256"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-310"></span><span id="promptedInput"><span class="annot"><span class="annottext">promptedInput :: forall (m :: * -&gt; *) a.
MonadIO m =&gt;
(TermOps -&gt; Prefix -&gt; InputT m a)
-&gt; (FileOps -&gt; IO a) -&gt; FilePath -&gt; InputT m a
</span><a href="System.Console.Haskeline.html#promptedInput"><span class="hs-identifier hs-var hs-var">promptedInput</span></a></span></span><span> </span><span id="local-6989586621679099730"><span class="annot"><span class="annottext">TermOps -&gt; Prefix -&gt; InputT m a
</span><a href="#local-6989586621679099730"><span class="hs-identifier hs-var">doTerm</span></a></span></span><span> </span><span id="local-6989586621679099729"><span class="annot"><span class="annottext">FileOps -&gt; IO a
</span><a href="#local-6989586621679099729"><span class="hs-identifier hs-var">doFile</span></a></span></span><span> </span><span id="local-6989586621679099728"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679099728"><span class="hs-identifier hs-var">prompt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-311"></span><span>    </span><span class="hs-comment">-- If other parts of the program have written text, make sure that it</span><span>
</span><span id="line-312"></span><span>    </span><span class="hs-comment">-- appears before we interact with the user on the terminal.</span><span>
</span><span id="line-313"></span><span>    </span><span class="annot"><span class="annottext">IO () -&gt; InputT m ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; InputT m ()) -&gt; IO () -&gt; InputT m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Handle -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hFlush"><span class="hs-identifier hs-var">hFlush</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="../../base/src/GHC.IO.StdHandles.html#stdout"><span class="hs-identifier hs-var">stdout</span></a></span><span>
</span><span id="line-314"></span><span>    </span><span id="local-6989586621679099725"><span class="annot"><span class="annottext">RunTerm
</span><a href="#local-6989586621679099725"><span class="hs-identifier hs-var">rterm</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReaderT
  RunTerm
  (ReaderT
     (IORef History)
     (ReaderT
        (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))
  RunTerm
-&gt; InputT m RunTerm
forall (m :: * -&gt; *) a.
ReaderT
  RunTerm
  (ReaderT
     (IORef History)
     (ReaderT
        (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))
  a
-&gt; InputT m a
</span><a href="System.Console.Haskeline.InputT.html#InputT"><span class="hs-identifier hs-var">InputT</span></a></span><span> </span><span class="annot"><span class="annottext">ReaderT
  RunTerm
  (ReaderT
     (IORef History)
     (ReaderT
        (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))
  RunTerm
forall r (m :: * -&gt; *). MonadReader r m =&gt; m r
</span><a href="System.Console.Haskeline.Monads.html#ask"><span class="hs-identifier hs-var">ask</span></a></span><span>
</span><span id="line-315"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">RunTerm -&gt; Either TermOps FileOps
</span><a href="System.Console.Haskeline.Term.html#termOps"><span class="hs-identifier hs-var hs-var">termOps</span></a></span><span> </span><span class="annot"><span class="annottext">RunTerm
</span><a href="#local-6989586621679099725"><span class="hs-identifier hs-var">rterm</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-316"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621679099723"><span class="annot"><span class="annottext">FileOps
</span><a href="#local-6989586621679099723"><span class="hs-identifier hs-var">fops</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IO a -&gt; InputT m a
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO a -&gt; InputT m a) -&gt; IO a -&gt; InputT m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-317"></span><span>                        </span><span class="annot"><span class="annottext">RunTerm -&gt; FilePath -&gt; IO ()
</span><a href="System.Console.Haskeline.Term.html#putStrOut"><span class="hs-identifier hs-var hs-var">putStrOut</span></a></span><span> </span><span class="annot"><span class="annottext">RunTerm
</span><a href="#local-6989586621679099725"><span class="hs-identifier hs-var">rterm</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679099728"><span class="hs-identifier hs-var">prompt</span></a></span><span>
</span><span id="line-318"></span><span>                        </span><span class="annot"><span class="annottext">FileOps -&gt; forall a. IO a -&gt; IO a
</span><a href="System.Console.Haskeline.Term.html#wrapFileInput"><span class="hs-identifier hs-var hs-var">wrapFileInput</span></a></span><span> </span><span class="annot"><span class="annottext">FileOps
</span><a href="#local-6989586621679099723"><span class="hs-identifier hs-var">fops</span></a></span><span> </span><span class="annot"><span class="annottext">(IO a -&gt; IO a) -&gt; IO a -&gt; IO a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FileOps -&gt; IO a
</span><a href="#local-6989586621679099729"><span class="hs-identifier hs-var">doFile</span></a></span><span> </span><span class="annot"><span class="annottext">FileOps
</span><a href="#local-6989586621679099723"><span class="hs-identifier hs-var">fops</span></a></span><span>
</span><span id="line-319"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621679099721"><span class="annot"><span class="annottext">TermOps
</span><a href="#local-6989586621679099721"><span class="hs-identifier hs-var">tops</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-320"></span><span>            </span><span class="hs-comment">-- Convert the full prompt to graphemes (not just the last line)</span><span>
</span><span id="line-321"></span><span>            </span><span class="hs-comment">-- to account for the `\ESC...STX` appearing anywhere in it.</span><span>
</span><span id="line-322"></span><span>            </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679099720"><span class="annot"><span class="annottext">prompt' :: Prefix
</span><a href="#local-6989586621679099720"><span class="hs-identifier hs-var hs-var">prompt'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; Prefix
</span><a href="System.Console.Haskeline.LineState.html#stringToGraphemes"><span class="hs-identifier hs-var">stringToGraphemes</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679099728"><span class="hs-identifier hs-var">prompt</span></a></span><span>
</span><span id="line-323"></span><span>            </span><span class="hs-comment">-- If the prompt contains newlines, print all but the last line.</span><span>
</span><span id="line-324"></span><span>            </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679099715"><span class="annot"><span class="annottext">Prefix
</span><a href="#local-6989586621679099715"><span class="hs-identifier hs-var">lastLine</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679099714"><span class="annot"><span class="annottext">Prefix
</span><a href="#local-6989586621679099714"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Grapheme -&gt; Bool) -&gt; Prefix -&gt; (Prefix, Prefix)
forall a. (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
</span><a href="../../base/src/GHC.List.html#break"><span class="hs-identifier hs-var">break</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Grapheme -&gt; Prefix -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-operator hs-var">`elem`</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; Prefix
</span><a href="System.Console.Haskeline.LineState.html#stringToGraphemes"><span class="hs-identifier hs-var">stringToGraphemes</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;\r\n&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-325"></span><span>                                    </span><span class="annot"><span class="annottext">(Prefix -&gt; (Prefix, Prefix)) -&gt; Prefix -&gt; (Prefix, Prefix)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Prefix -&gt; Prefix
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">Prefix
</span><a href="#local-6989586621679099720"><span class="hs-identifier hs-var">prompt'</span></a></span><span>
</span><span id="line-326"></span><span>            </span><span class="annot"><span class="annottext">FilePath -&gt; InputT m ()
forall (m :: * -&gt; *). MonadIO m =&gt; FilePath -&gt; InputT m ()
</span><a href="System.Console.Haskeline.html#outputStr"><span class="hs-identifier hs-var">outputStr</span></a></span><span> </span><span class="annot"><span class="annottext">(FilePath -&gt; InputT m ()) -&gt; FilePath -&gt; InputT m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Prefix -&gt; FilePath
</span><a href="System.Console.Haskeline.LineState.html#graphemesToString"><span class="hs-identifier hs-var">graphemesToString</span></a></span><span> </span><span class="annot"><span class="annottext">(Prefix -&gt; FilePath) -&gt; Prefix -&gt; FilePath
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Prefix -&gt; Prefix
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">Prefix
</span><a href="#local-6989586621679099714"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-327"></span><span>            </span><span class="annot"><span class="annottext">TermOps -&gt; Prefix -&gt; InputT m a
</span><a href="#local-6989586621679099730"><span class="hs-identifier hs-var">doTerm</span></a></span><span> </span><span class="annot"><span class="annottext">TermOps
</span><a href="#local-6989586621679099721"><span class="hs-identifier hs-var">tops</span></a></span><span> </span><span class="annot"><span class="annottext">(Prefix -&gt; InputT m a) -&gt; Prefix -&gt; InputT m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Prefix -&gt; Prefix
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">Prefix
</span><a href="#local-6989586621679099715"><span class="hs-identifier hs-var">lastLine</span></a></span><span>
</span><span id="line-328"></span><span>
</span><span id="line-329"></span><span class="hs-comment">{- | If Ctrl-C is pressed during the given action, throw an exception
of type 'Interrupt'.  For example:

&gt; tryAction :: InputT IO ()
&gt; tryAction = handle (\Interrupt -&gt; outputStrLn &quot;Cancelled.&quot;)
&gt;                $ withInterrupt $ someLongAction

The action can handle the interrupt itself; a new 'Interrupt' exception will be thrown
every time Ctrl-C is pressed.

&gt; tryAction :: InputT IO ()
&gt; tryAction = withInterrupt loop
&gt;     where loop = handle (\Interrupt -&gt; outputStrLn &quot;Cancelled; try again.&quot; &gt;&gt; loop)
&gt;                    someLongAction

This behavior differs from GHC's built-in Ctrl-C handling, which
may immediately terminate the program after the second time that the user presses
Ctrl-C.

-}</span><span>
</span><span id="line-349"></span><span id="local-6989586621679100118"><span id="local-6989586621679100119"><span class="annot"><a href="System.Console.Haskeline.html#withInterrupt"><span class="hs-identifier hs-type">withInterrupt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100119"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../exceptions/src/Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100119"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#InputT"><span class="hs-identifier hs-type">InputT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100119"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100118"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#InputT"><span class="hs-identifier hs-type">InputT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100119"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100118"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-350"></span><span id="withInterrupt"><span class="annot"><span class="annottext">withInterrupt :: forall (m :: * -&gt; *) a.
(MonadIO m, MonadMask m) =&gt;
InputT m a -&gt; InputT m a
</span><a href="System.Console.Haskeline.html#withInterrupt"><span class="hs-identifier hs-var hs-var">withInterrupt</span></a></span></span><span> </span><span id="local-6989586621679099697"><span class="annot"><span class="annottext">InputT m a
</span><a href="#local-6989586621679099697"><span class="hs-identifier hs-var">act</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-351"></span><span>    </span><span id="local-6989586621679099696"><span class="annot"><span class="annottext">RunTerm
</span><a href="#local-6989586621679099696"><span class="hs-identifier hs-var">rterm</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReaderT
  RunTerm
  (ReaderT
     (IORef History)
     (ReaderT
        (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))
  RunTerm
-&gt; InputT m RunTerm
forall (m :: * -&gt; *) a.
ReaderT
  RunTerm
  (ReaderT
     (IORef History)
     (ReaderT
        (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))
  a
-&gt; InputT m a
</span><a href="System.Console.Haskeline.InputT.html#InputT"><span class="hs-identifier hs-var">InputT</span></a></span><span> </span><span class="annot"><span class="annottext">ReaderT
  RunTerm
  (ReaderT
     (IORef History)
     (ReaderT
        (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))
  RunTerm
forall r (m :: * -&gt; *). MonadReader r m =&gt; m r
</span><a href="System.Console.Haskeline.Monads.html#ask"><span class="hs-identifier hs-var">ask</span></a></span><span>
</span><span id="line-352"></span><span>    </span><span class="annot"><span class="annottext">RunTerm
-&gt; forall a (m :: * -&gt; *). (MonadIO m, MonadMask m) =&gt; m a -&gt; m a
</span><a href="System.Console.Haskeline.Term.html#wrapInterrupt"><span class="hs-identifier hs-var hs-var">wrapInterrupt</span></a></span><span> </span><span class="annot"><span class="annottext">RunTerm
</span><a href="#local-6989586621679099696"><span class="hs-identifier hs-var">rterm</span></a></span><span> </span><span class="annot"><span class="annottext">InputT m a
</span><a href="#local-6989586621679099697"><span class="hs-identifier hs-var">act</span></a></span><span>
</span><span id="line-353"></span><span>
</span><span id="line-354"></span><span class="hs-comment">-- | Catch and handle an exception of type 'Interrupt'.</span><span>
</span><span id="line-355"></span><span class="hs-comment">--</span><span>
</span><span id="line-356"></span><span class="hs-comment">-- &gt; handleInterrupt f = handle $ \Interrupt -&gt; f</span><span>
</span><span id="line-357"></span><span id="local-6989586621679100112"><span id="local-6989586621679100113"><span class="annot"><a href="System.Console.Haskeline.html#handleInterrupt"><span class="hs-identifier hs-type">handleInterrupt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../exceptions/src/Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100113"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679100113"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100112"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679100113"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100112"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679100113"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100112"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-358"></span><span id="handleInterrupt"><span class="annot"><span class="annottext">handleInterrupt :: forall (m :: * -&gt; *) a. MonadMask m =&gt; m a -&gt; m a -&gt; m a
</span><a href="System.Console.Haskeline.html#handleInterrupt"><span class="hs-identifier hs-var hs-var">handleInterrupt</span></a></span></span><span> </span><span id="local-6989586621679099688"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679099688"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Interrupt -&gt; m a) -&gt; m a -&gt; m a
forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
(e -&gt; m a) -&gt; m a -&gt; m a
</span><a href="../../exceptions/src/Control.Monad.Catch.html#handle"><span class="hs-identifier hs-var">handle</span></a></span><span> </span><span class="annot"><span class="annottext">((Interrupt -&gt; m a) -&gt; m a -&gt; m a)
-&gt; (Interrupt -&gt; m a) -&gt; m a -&gt; m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">Interrupt
</span><a href="System.Console.Haskeline.Term.html#Interrupt"><span class="hs-identifier hs-var">Interrupt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679099688"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-359"></span><span>
</span><span id="line-360"></span><span class="hs-comment">{- | Return a printing function, which in terminal-style interactions is
thread-safe and may be run concurrently with user input without affecting the
prompt. -}</span><span>
</span><span id="line-363"></span><span id="local-6989586621679100102"><span class="annot"><a href="System.Console.Haskeline.html#getExternalPrint"><span class="hs-identifier hs-type">getExternalPrint</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100102"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.InputT.html#InputT"><span class="hs-identifier hs-type">InputT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679100102"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span></span><span>
</span><span id="line-364"></span><span id="getExternalPrint"><span class="annot"><span class="annottext">getExternalPrint :: forall (m :: * -&gt; *). MonadIO m =&gt; InputT m (FilePath -&gt; IO ())
</span><a href="System.Console.Haskeline.html#getExternalPrint"><span class="hs-identifier hs-var hs-var">getExternalPrint</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-365"></span><span>    </span><span id="local-6989586621679099677"><span class="annot"><span class="annottext">RunTerm
</span><a href="#local-6989586621679099677"><span class="hs-identifier hs-var">rterm</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReaderT
  RunTerm
  (ReaderT
     (IORef History)
     (ReaderT
        (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))
  RunTerm
-&gt; InputT m RunTerm
forall (m :: * -&gt; *) a.
ReaderT
  RunTerm
  (ReaderT
     (IORef History)
     (ReaderT
        (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))
  a
-&gt; InputT m a
</span><a href="System.Console.Haskeline.InputT.html#InputT"><span class="hs-identifier hs-var">InputT</span></a></span><span> </span><span class="annot"><span class="annottext">ReaderT
  RunTerm
  (ReaderT
     (IORef History)
     (ReaderT
        (IORef KillRing) (ReaderT Prefs (ReaderT (Settings m) m))))
  RunTerm
forall r (m :: * -&gt; *). MonadReader r m =&gt; m r
</span><a href="System.Console.Haskeline.Monads.html#ask"><span class="hs-identifier hs-var">ask</span></a></span><span>
</span><span id="line-366"></span><span>    </span><span class="annot"><span class="annottext">(FilePath -&gt; IO ()) -&gt; InputT m (FilePath -&gt; IO ())
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">((FilePath -&gt; IO ()) -&gt; InputT m (FilePath -&gt; IO ()))
-&gt; (FilePath -&gt; IO ()) -&gt; InputT m (FilePath -&gt; IO ())
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">RunTerm -&gt; Either TermOps FileOps
</span><a href="System.Console.Haskeline.Term.html#termOps"><span class="hs-identifier hs-var hs-var">termOps</span></a></span><span> </span><span class="annot"><span class="annottext">RunTerm
</span><a href="#local-6989586621679099677"><span class="hs-identifier hs-var">rterm</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-367"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span class="annot"><span class="annottext">FileOps
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">RunTerm -&gt; FilePath -&gt; IO ()
</span><a href="System.Console.Haskeline.Term.html#putStrOut"><span class="hs-identifier hs-var hs-var">putStrOut</span></a></span><span> </span><span class="annot"><span class="annottext">RunTerm
</span><a href="#local-6989586621679099677"><span class="hs-identifier hs-var">rterm</span></a></span><span>
</span><span id="line-368"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621679099676"><span class="annot"><span class="annottext">TermOps
</span><a href="#local-6989586621679099676"><span class="hs-identifier hs-var">tops</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TermOps -&gt; FilePath -&gt; IO ()
</span><a href="System.Console.Haskeline.Term.html#externalPrint"><span class="hs-identifier hs-var hs-var">externalPrint</span></a></span><span> </span><span class="annot"><span class="annottext">TermOps
</span><a href="#local-6989586621679099676"><span class="hs-identifier hs-var">tops</span></a></span><span>
</span><span id="line-369"></span></pre></body></html>